#tymm
1 messages · Page 1 of 1 (latest)
👋 Thanks for reaching out
but is there an easier way to get the converted total based on the currency?
What do you mean exactly by "based on the currency" ?
Each invoice in billed by a specific currency:
https://stripe.com/docs/api/invoices/object#invoice_object-currency
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
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
....
alright, thanks