#tymm

1 messages · Page 1 of 1 (latest)

severe mauveBOT
green narwhal
pseudo briar
#

im trying to get the amount charged in an invoice. however the amount that im getting is a whole number without decimals. in countries like japan it make sense because its lowest currency is 1, but in singapore they have cents. so what do u recommend me to do in getting the correct currency format for all the other currencies?

#

currently im doing checkings one by one, therefore im asking if stripe provides an easier/ more elegant way of doing this

green narwhal
#

Ah thanks for your explanation. All Stripe amounts using the API are in the smallest currency Unit. So according to each currency you need to do the adequate conversion to the Decimal amount you want. Not sure, but I think you can find in the community libraries the does this or you can implement this in your integration. Something like:
switch (currency)
case 'eur': amount/100
case 'abc' : amount/x
....

https://stripe.com/docs/currencies#zero-decimal

pseudo briar
#

alright, thanks