#Cvijo
1 messages · Page 1 of 1 (latest)
Good question. Checking in to this. Is there a reason you are looking to avoid the normal conversion other than code cleanliness?
well problem are those edge cases currencies that has 0 decimal places like YPN so i have to do cases in my code
Ah, are you not talking about the Decimal struct? https://learn.microsoft.com/en-us/dotnet/api/system.decimal?view=net-8.0
Is this question more asking if we indicate in the API/SDK if a given currency is zero-decimal?
well for example in paymentIntent i got amounts as long so 100€ you will send to me as 10000 .. so for this i can just devide by 100, but for JPN if you send 100 jpn i should not devide if i get this correctly so i was thinking that SDK might have some utils, extensions for that
Gotcha, thank you for the clarification. Checking in to that and will get back to you
btw i asked chat gpt he gave me some answers but in current sdk there are no such extensions, some replays for gpt: Stripe.AmountUtils.ConvertAmountToString(amount, "usd"); StripeConfiguration.Get().StripeDecimalUtils.ConvertAmountToString(amountInCents, currency); StripeDecimalUtils.ConvertAmountToString(amountInCents, currency); but all of those doesnt exists 🙂
So unfortunately it looks like our API and SDK do not currently have a way to differentiate these currencies programmatically. We likely will never change which currencies we do and don't do this with, so you can take that info from the doc and use that to guide how your code treats prices in each of those currencies.
ok, tnx Pompey