Re: [w3c/browser-payment-api] Should user agent validate currency? (#490)

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