돈의 보석 separate lists을 포함 않지만, 불행하게도, 그들은 merged together 있습니다 : 그러나이 것을
Money::Currency.send(:parse_currency_file, 'currency_iso.json')
#=> {
# :aed=>{:priority=>100, :iso_code=>"AED", :name=>"United Arab Emirates Dirham", :symbol=>"د.إ", :alternate_symbols=>["DH", "Dhs"], :subunit=>"Fils", :subunit_to_unit=>100, :symbol_first=>true, :html_entity=>"", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"784", :smallest_denomination=>25},
# :afn=>{:priority=>100, :iso_code=>"AFN", :name=>"Afghan Afghani", :symbol=>"؋", :alternate_symbols=>["Af", "Afs"], :subunit=>"Pul", :subunit_to_unit=>100, :symbol_first=>false, :html_entity=>"", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"971", :smallest_denomination=>100},
# :all=>{:priority=>100, :iso_code=>"ALL", :name=>"Albanian Lek", :symbol=>"L", :disambiguate_symbol=>"Lek", :alternate_symbols=>["Lek"], :subunit=>"Qintar", :subunit_to_unit=>100, :symbol_first=>false, :html_entity=>"", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"008", :smallest_denomination=>100},
# ...
# :zar=>{:priority=>100, :iso_code=>"ZAR", :name=>"South African Rand", :symbol=>"R", :alternate_symbols=>[], :subunit=>"Cent", :subunit_to_unit=>100, :symbol_first=>true, :html_entity=>"R", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"710", :smallest_denomination=>10},
# :zmk=>{:priority=>100, :iso_code=>"ZMK", :name=>"Zambian Kwacha", :symbol=>"ZK", :disambiguate_symbol=>"ZMK", :alternate_symbols=>[], :subunit=>"Ngwee", :subunit_to_unit=>100, :symbol_first=>false, :html_entity=>"", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"894", :smallest_denomination=>5},
# :zmw=>{:priority=>100, :iso_code=>"ZMW", :name=>"Zambian Kwacha", :symbol=>"ZK", :disambiguate_symbol=>"ZMW", :alternate_symbols=>[], :subunit=>"Ngwee", :subunit_to_unit=>100, :symbol_first=>false, :html_entity=>"", :decimal_mark=>".", :thousands_separator=>",", :iso_numeric=>"967", :smallest_denomination=>5}}
# }
참고 : 그냥 currency_iso.json
목록을 얻으려면 수동으로 코드를 호출 할 수
def load_currencies
currencies = parse_currency_file("currency_iso.json")
currencies.merge! parse_currency_file("currency_non_iso.json")
currencies.merge! parse_currency_file("currency_backwards_compatible.json")
end
개인용 메소드이므로 향후 버전에서 변경 될 수 있습니다.
https://www.currency-iso.org/dam/downloads/lists/list_one.xml – JLB
"방법이 있습니까"를 묻는 경우, 시도한 것을 보여주고 범위를 좁히지 않으면 질문이 즉시 광범위하게됩니다. 쿼리의 "방법이 있니?" "예"는 누구에게 도움이되지 않습니다. "나는 이것을 시도하고 이것과 그들이 효과가 없다"는 질문을 좁히고 우리가 당신이 정말로 묻고있는 것을 짐작할 수 없게한다. "[ask]"와 연결된 페이지, "[mcve]"와 그 링크 된 페이지, "[Stack Overflow 사용자에게 얼마나 많은 연구 노력이 필요합니까?] (http://meta.stackoverflow.com/questions/)를 읽으십시오. 261592). "왜 우리는 더 자세한 내용과 질문이 필요한지 설명하는 데 도움이 될 것입니다. –