-
Notifications
You must be signed in to change notification settings - Fork 45
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
Format using ISO Code #46
Comments
I agree symbols (signs) can be ambiguous, but this is what people expect when looking at money. The symbol primarly defines that a value represents money. That money later is formalized by ISO with codes and numbers, doesn't take this away. The ISO code is only used in edge cases, where it must be totally clear which currency is used (legal, exchange, etc). Also NodaMoney can be used by non-ISO currencies like bitcoin or your own imaginary currency like some game currency or facebook coins. So I don't think Also using Of course NodaMoney should support formatting with the ISO code, which is on the planning, but Format Strings can be a complex job :-(. There is a way to do it by using I was thinking about adding a couple of Standard Money Format Strings:
What do you think? |
Hey, all. I'd like to start contributing to NodaMoney. Can I have a try at implementing one of the Format Strings? |
Yes, all help is welcome. Send it as a pull request. Thanks! |
Format C, I and F are working, see https://github.com/remyvd/NodaMoney/blob/master/tests/NodaMoney.Tests/MoneyFormattableSpec.cs |
At the moment, ToString formats money using its currency symbol, but symbols can be ambiguous. Please add a method that formats money using its unambiguous currency code instead.
See wikipedia's section on formatting rules: https://en.wikipedia.org/wiki/ISO_4217#Position_of_ISO_4217_code_in_amounts
In my opinion, formatting using the ISO code should have been the default result of calling
Money.ToString()
and formatting using the currency symbol should have been the result of callingMoney.ToString("C")
The text was updated successfully, but these errors were encountered: