- From: Marcos Cáceres <notifications@github.com>
- Date: Thu, 30 Mar 2017 21:22:33 -0700
- To: w3c/browser-payment-api <browser-payment-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 31 March 2017 04:23:07 UTC
I'll note that at Intl.NumberFormat doesn't care about case (it normalizes to uppercase), but does do validation:
```JS
const f = new Intl.NumberFormat(navigator.languages, {
style: "currency",
currency: "uSd",
currencyDisplay: "symbol",
});
f.resolvedOptions(); // currency: "USD"
// Throws RangeError: currency is not a well-formed currency code
new Intl.NumberFormat(navigator.languages, {
style: "currency",
currency: "what is this I don't even",
currencyDisplay: "symbol",
});
```
So it might make sense to actually do validation also, given that we know what the currency system _a priori_.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/browser-payment-api/issues/490#issuecomment-290612321
Received on Friday, 31 March 2017 04:23:07 UTC