3 ms·
Customer was charged $0.995 after fees, how to represent in your data model with integer cents?
by microgpt 4mo ago
Customer was charged $0.995 after fees, how to represent in your data model with integer cents?
- xprnio 4mo agoRound it up
- microgpt 4mo agoCharge $0.995 Refund $1.00 Repeat
- SJC_Hacker 4mo agoCharge $0.995 Charge Actual $1.00 Refund $1.000 Alternately Charge $0.995 ERROR CHARGE AMOUNT MUST BE ROUNDED TO NEAREST CENT
- microgpt 4mo agoIn my scenario your payment gateway added a $0.005 fee. You told it $0.99.
- lxgr 4mo agoYou'll have to decide when and how to round. Keeping individual billing items at high precision and rounding after summing them up can work; defining and documenting a rounding policy (or complying with whatever's legally required in your jurisdiction/domain) and rounding each individual billed item can as well.
- snsnsjjsjsiisa 4mo agoYou use 1/1000th or 1/10000th or whatever you need. You do not need “cents”.
- denismenace 4mo agoCurrency: USD Amount: 99500 Decimals: 5
- microgpt 4mo agoCongrats m8 you invented floating point
- denismenace 4mo agoThen you have no idea how floating point works. (Hint: its in the name)
- FabHK 4mo agoHow is the client going to pay that? They can't be charged half a cent.