W3C home > Mailing lists > Public > public-payments-wg@w3.org > December 2015

[webpayments] Expression of monetary amounts (#40)

From: Manu Sporny <notifications@github.com>
Date: Tue, 15 Dec 2015 22:03:50 -0800
To: w3c/webpayments <webpayments@noreply.github.com>
Message-ID: <w3c/webpayments/issues/40@github.com>
The paymentRequest API currently suggests that we express monetary amounts using a mantissa and exponent: 

http://wicg.github.io/paymentrequest/specs/paymentrequest.html#currencyamount
```javascript
"amount": { "currencyCode": "USD", "mantissa": 5500, "exponent": 2 }, // US$55.00
```

The Web Payments CG Browser API suggests that we use strings for the amounts with a currency code:

http://wicg.github.io/web-payments-browser-api/#processing-a-payment-request
```javascript
transfer: {
  amount: '4.35',
  currency: 'USD'
},
```

How should monetary amounts be expressed in the API?

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments/issues/40
Received on Wednesday, 16 December 2015 06:04:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:43:12 UTC