top | item 41777737

(no title)

bojanz | 1 year ago

I like the support for custom currencies, as that is an edge case that often pops up.

On the other hand, be careful about tying the symbol to the currency, as symbols are locale specific. For example, the symbol for USD is $ in eu-US but US$ in en-CA and en-AU (Canada and Australia), and then $US in French locales.

https://cldr.unicode.org/ is the magical dataset behind most good implementations that deal with currency display. Updated twice a year, available in JSON, providing currency symbols and formatting rules for all locales, as well as country => currency mappings and other useful information.

Disclaimer: I maintain a Go solution in this problem space: https://github.com/bojanz/currency

discuss

order

samatman|1 year ago

I know this is a mere quibble as a rider on a helpful post, but a disclosure is not a disclaimer.

Disclaimers separate you from the comment, examples:

> Disclaimer: I am not a lawyer and this is not legal advice

> [says things about $company] Disclaimer: I don't work for $company, I heard this from someone who does but I can't link to a primary source

Disclosures are additional information which you think it's proper to add, to be open about your interest or stake in the topic:

> Disclosure: I wrote a similar library

> [replies to thing about $company] Disclosure: I used to work for $company

ahoka|1 year ago

Disclaimer is more often used for humblebrag, not to disclose any information.

bojanz|1 year ago

Right, indeed!

dkarl|1 year ago

I'm curious, is there a standard practice of library developers in a certain space collaborating across languages, sharing issues and corner cases and solutions? Is this a common practice with a name? Or is it up to you to look through issues and release notes on projects in the same space to glean useful information?

andylynch|1 year ago

Not sure there’s a particular name beyond ‘working group’ or ‘technical committee’.

CLDR a really interesting one though, their list of users is quite something too.