【发布时间】:2015-11-01 13:51:51
【问题描述】:
我当前的配置格式似乎太多余了。如何将其转换为下一个预期的配置格式?
我的预期配置是:
MoneyRails.configure do |config|
register_currency("TWD", 100)
register_currency("USD", 100)
....
end
我目前的配置是:
MoneyRails.configure do |config|
config.register_currency = {
:priority => 1,
:iso_code => "TWD",
:name => "TWD",
:symbol => "NT$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
config.register_currency = {
:priority => 1,
:iso_code => "USD",
:name => "USD",
:symbol => "$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
config.register_currency = {
:priority => 1,
:iso_code => "SGD",
:name => "SGD",
:symbol => "$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
config.register_currency = {
:priority => 1,
:iso_code => "THB",
:name => "THB",
:symbol => "$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
config.register_currency = {
:priority => 1,
:iso_code => "AUD",
:name => "AUD",
:symbol => "$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
config.register_currency = {
:priority => 1,
:iso_code => "KRW",
:name => "KRW",
:symbol => "$ ",
:symbol_first => true,
:subunit => "Subcent",
:subunit_to_unit => 100,
:thousands_separator => ",",
:decimal_mark => "."
}
...
end
【问题讨论】:
-
欢迎来到 Stack Overflow。当您尝试从当前版本减少到所需版本时发生了什么?我看没问题,只是一个愿望清单。我们希望了解您尝试执行的操作以及您对其无法正常工作的原因的解释。
标签: ruby money-rails