varunsrin / rusty_money

Money library for Rust
MIT License
93 stars 34 forks source link

Wrong symbol for currency RON #62

Closed a-cristi closed 1 year ago

a-cristi commented 3 years ago

In iso_currencies.rs the Romanian Leu is defined as:

        RON : {
            exponent: 2,
            iso_alpha_code: "RON",
            iso_numeric_code: "946",
            locale: EnEu,
            minor_units: 1,
            name: "Romanian Leu",
            symbol: "ر.ق",
            symbol_first: false,
        },

The symbol should be L (see the wikipedia page for the currency).

varunsrin commented 3 years ago

thanks for flagging, will fix soon

brokenthorn commented 1 year ago

There are 2 currencies for Romania according to ISO-4217:

Alpha Code Numeric Code Digits after decimal separator Currency name Alternative currency name
RON 946 2 Romanian leu Romanian new leu
ROL 642 0 Romanian leu Romanian old leu
brokenthorn commented 1 year ago

@a-cristi, is this issue fixed for you now?

a-cristi commented 1 year ago

Yes, this is fixed now. The RON is the currently used currency, I guess you could name the ROL one as "Romanian old Leu" to distinguish between them, but I'm not sure if that is actually correct or not.

As far as the symbols go this is now correct however. Thank you!

brokenthorn commented 1 year ago

Yes, this is fixed now. The RON is the currently used currency, I guess you could name the ROL one as "Romanian old Leu" to distinguish between them, but I'm not sure if that is actually correct or not.

As far as the symbols go this is now correct however. Thank you!

I found the ISO-4217 current curries list. Seems RON has minor units = 2, not 1, as we have currently. I will create a new PR to fix this. The name is correct though.

image

And the historic currencies list also from ISO-4217, the correct name for ROL shows up as "Old Leu":

image

We should use the current standard name for RON and the historic currencies list name for the old ROL currency.

Does everyone agree to this?

brokenthorn commented 1 year ago

I need some clarification. Does rusty_money, in defining currencies, use exponent to mean the power to raise the radix (base) to, in order to get the floating point position?

And does it use minor_units to represent the smallest coin amount, i.e. 1 for GBP means 1 pence (1/100 of a pound sterling)? For USD the setup is the same, only that 1 "minor_units" means 1 cent?