-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Apply default rounding on MonetaryAmount.ToString #307
Comments
Code fix for money:
|
Just to clarify: the number will be rounded to the currency's fractional digits? |
Thank you for the change but I'm afraid we have to rollback it. So please rollback and recommit it with the ticket number and then force push. Speaking about the change itself: it wasn't properly discussed, reviewed or tested while it affects backward compatibility. Only I left a comment with some concern about it and even the comment wasn't answered. Let me extend it. I'm pretty sure that we shouldn't do this at least in this manner.
For example when you do the If the
This means that the master branch is broken.
So here I have a proposition: |
friendly reminder @atsticks |
This is a problematic change, esp. as it breaks assertion error messages as they now effectively report an invalid value (a formatted one instead of the real one. Same applies to values shown in a debugger. I've filed #357 to hopefully roll this back. I'd argue that |
When using toString() on an amount in Moneta it returns the full number, which is not what most users would expect. Instead I propose to apply default rounding before creating the amount String returned, e.g. the following snippet
results in
CHF 2000.12
instead ofCHF 2000.12345
. I think this is what most users would expect.The text was updated successfully, but these errors were encountered: