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

CLP - Chilean Peso Minor Amount #37

Closed
neilhosey opened this issue Dec 21, 2015 · 5 comments
Closed

CLP - Chilean Peso Minor Amount #37

neilhosey opened this issue Dec 21, 2015 · 5 comments
Assignees
Labels

Comments

@neilhosey
Copy link

Hi,

For CLP amounts, it doesn't add on 2 zero's for the minor amount. Is this expected behaviour or a bug?

Thanks
Neil

@dgg dgg self-assigned this Dec 21, 2015
@dgg dgg added the bug label Dec 21, 2015
@dgg
Copy link
Owner

dgg commented Dec 21, 2015

Hi, Neil

I am not sure what you mean by "add 2 zeroes".
However, as far as I know, CLP does not have any significant decimals so in the case of a Money instance, both major and minor amounts will be integral (regardless of the decimal part of its amount).
That is indeed the desired behavior.

Does that answer your question?

Thanks for using NMoneys

@neilhosey
Copy link
Author

Hi,

Thanks for getting back so quick!

I see now, it turns out a payment gateway I am integrating to uses 2 sig decimals for CLP which is annoying!

Is there an easy way to override this behaviour to replace the old CLP datA?

@neilhosey
Copy link
Author

i want to set the SignificantDecimalDigits to 2 for CLP , without having to rebuild.

@dgg
Copy link
Owner

dgg commented Dec 22, 2015

Unfortunately, changing currency information without rebuilding is not possible at the moment. Currency information is embedded in the assembly, so changing such information would mean rebuilding the solution (which is pretty easy, though).
But then you'd be left with a custom build.

If what the payment gateway needs is a number, you should be able to send the integral amount without problems.
I what the payment gateway needs is the amount as a string you can use a custom NumberFormatInfo with 2 decimals and pass it to the .ToString(IFormatProvider) overload as you can see in https://github.com/dgg/nmoneys/wiki/DeveloperQuickStart#formatting

@dgg
Copy link
Owner

dgg commented Jul 18, 2016

Cleaning issues

@dgg dgg closed this as completed Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants