go-money
go-money copied to clipboard
digit group separation and decimal split separator
This is a great package. Would you mind updating the documentation on how we can use different formats used around the world, like other European countries, not to mention India where they separate digit groups differently?
I would mainly like to get
1.244,90 €
instead of
€1,244.90
Hey @trobert2!
You can always add new custom currency using AddCurrency
method. It accepts:
Fraction int
Grapheme string
Template string
Decimal string
Thousand string
to make your custom currency display in whatever matter you want. There is a big list of currencies already there. https://github.com/Rhymond/go-money/blob/master/currency.go If you can't find yours please let me know and we can update the list.
Juste in case, you didn't get the notification ;)
Hi Rhymon, It is quite clear that one can add its own flavor of grouping signs, but the grouping of currency in the European Union is done with , as decimal separator and . as thousand separator. Anything else is just wrong. The advantage of your package is that one does not have to modify for every country but can rely on correctness of the code base. Please change accordingly. Cheers Joerg
I forgot: the template is "1 $" in Europe.