Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cents in transactions are being rounded down. #4

Open
kpras opened this issue Jan 21, 2020 · 0 comments
Open

Cents in transactions are being rounded down. #4

kpras opened this issue Jan 21, 2020 · 0 comments

Comments

@kpras
Copy link
Contributor

kpras commented Jan 21, 2020

Amount = (int)processPaymentRequest.OrderTotal * 100,

Amount = (int)processPaymentRequest.OrderTotal * 100

The cast to int here is having the effect of rounding down any cents after the decimal point. This should probably be written as :

Amount = (int)(processPaymentRequest.OrderTotal * 100)

Here is a fiddle illustrating the issue and suggested change. https://dotnetfiddle.net/89qyE1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant