-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
V4v2021-02-25 Clientv2021-02-25 Client
Description
Describe the bug
The Go library uses float for monetary values. Float is widely discouraged as it does not contain the necessary precision to handle currency values.
To Reproduce
Fetch a credit invoice of $-79.99. Multiply by 100.0 and convert to an `int:
// invoice.Subtotal = -79.99
x = int(invoice.Subtotal * 100.0)
assert.equal(-7999, x)Error: Not equal:
expected: -7999
actual : -7998
Expected behavior
Library should use a Decimal or other fixed-point
Your Environment
- Which version of this library are you using? v3.8.0 f4d23f4
- Which version of golang are you using? 1.14.9
Metadata
Metadata
Assignees
Labels
V4v2021-02-25 Clientv2021-02-25 Client