1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Multi-currency support: Money + Currency class improvements (#553)

* Money improvements

* Replace all old money usage
This commit is contained in:
Zach Gollwitzer 2024-03-18 11:21:00 -04:00 committed by GitHub
parent e5750d1a13
commit fe2fa0eac1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 2982 additions and 196 deletions

2520
config/currencies.yml Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1 @@
default_currency_options = { symbol: "$", precision: 2, delimiter: ",", separator: "." }
CURRENCY_OPTIONS = Hash.new { |hash, key| hash[key] = default_currency_options.dup }.merge(
"USD": { symbol: "$", precision: 2, delimiter: ",", separator: "." },
"EUR": { symbol: "", precision: 2, delimiter: ".", separator: "," },
"GBP": { symbol: "£", precision: 2, delimiter: ",", separator: "." },
"CAD": { symbol: "C$", precision: 2, delimiter: ",", separator: "." },
"MXN": { symbol: "MX$", precision: 2, delimiter: ",", separator: "." },
"HKD": { symbol: "HK$", precision: 2, delimiter: ",", separator: "." },
"CHF": { symbol: "CHF", precision: 2, delimiter: ".", separator: "," },
"SGD": { symbol: "S$", precision: 2, delimiter: ",", separator: "." },
"NZD": { symbol: "NZ$", precision: 2, delimiter: ",", separator: "." },
"AUD": { symbol: "A$", precision: 2, delimiter: ",", separator: "." },
"KRW": { symbol: "", precision: 0, delimiter: ",", separator: "." },
"INR": { symbol: "", precision: 2, delimiter: ",", separator: "." }
)
EXCHANGE_RATE_ENABLED = ENV["OPEN_EXCHANGE_APP_ID"].present?