2 ms·
I wonder if we need an entire CS work-over for this, like everything else we engineers do: instead of using text to display any given dollar sign, we should emi
by coding123 4y ago
I wonder if we need an entire CS work-over for this, like everything else we engineers do: instead of using text to display any given dollar sign, we should emit <money currency="USD">15.23</money> and allow only the browser to display from there - if the user is seeing their own currency, then it would just show a normal $ (or the one they typically see). But if it is not their currency, the browser should emit: $15.23 USD. Basically treat it like times - always pass the Z time, but let the browser render the local time.
- dmurray 4y agoForeign exchange is more complicated than that because exchange rates also have a time component: a price of 1 USD is not unconditionally equal to 1.40 AUD just because that's the exchange rate today. If I agree to a contract to pay 1400 AUD in a month's time (at check-in to my accommodation) I'm not OK with learning that I actually owe 1500 AUD, because my agreement was to pay 1000 USD and the rate has gone up from 1.40 to 1.50. Platforms like Airbnb don't always get this right, either, but they can at least specify the deal unambiguously in the fine print even when they display something else, and they should be able to accept payment of my 1400 AUD up front and take on (or hedge) any FX risk themselves.
- niij 4y agoTheir comment was just to disambiguate, when necessary, the various dollars, rials, yens, pesos, etc. Not for the browser to do currency conversions.