Chadtech / elm-money

All the worlds currencies.
https://package.elm-lang.org/packages/Chadtech/elm-money/latest/
MIT License
13 stars 2 forks source link

Should currency be shown before or after the number #8

Open simonh1000 opened 3 years ago

simonh1000 commented 3 years ago

The readme alludes to this question in formatting currencies, but it seems not to be solved in the code?

Chadtech commented 3 years ago

Yeah that is basically right, this is not a currency formatting package.

It does provide a lot of information that is very valuable to formatting (the currency symbol, the decimal digits, etc), but it doesnt do the other half of formatting, which is figuring out how currency is meant to be rendered in certain locales (does the symbol go on the left or the right, should the decimal be denoted . or ,, etc).

But if your project doesnt have requirements to format according to locale, then I dont think its too hard to make simple currency formatting. I would be happy to help write that function if you would like.

simonh1000 commented 3 years ago

As things stand we have a specification for currencies and number formatting and I've put in a stub of a solutions using yours and a number formatting package. In practise everyone is using US$ at present so the question of positioning does not arise. I guess it is an open question about whether the formatting is best left with your package or with "cuducos/elm-format-number" as, as you note, decimal and thousand notation is also part of the debate