Re: [w3c/browser-payment-api] Why is details.total.amount.value not a number? (#301)

> I meant that it should be defined as the same thing "number", with validity check being done via the "valid floating point number" algorithm.

That seems sensible, the type remains a string and just cross-reference the existing algorithm.

> You want an integer that represents the currency value divided by 1000 for tenths of a cent, or 10,000 for hundredths of a cent, or whatever folks agree on

This is certainly an ideal, but in the real world it becomes unmanageable. Firstly, you need to define exactly what unit of precision you're going to use - which itself is nearly impossible, because we have to support arbitrary currencies that may not exist yet, and some currencies have very large precision as-is (BTC supports eight decimal places, for example). So instead you need to define your integer units on a per-currency basis, except currencies can be revalued and change from under you, introducing additional precision (or dropping it).

-- 
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/301#issuecomment-263036124

Received on Saturday, 26 November 2016 00:51:22 UTC