You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if I would call this a feature or a bug or really anything more than just a thing, but I've noticed that intcomma decides to round off decimals of zero, but not other numbers. For instance:
journalize.intcomma(1000.0)'1,000'
This is the case even when the user submits a value with an explicitly fixed decimal place.
journalize.intcomma((1000.0).toFixed(1))'1,000'
I'm certain there is probably some good reason for this I'm unaware of, but I wanted to file this ticket since the second example above was not the behavior I expected as a user.
For what it's worth, it is also not the behavior of the old gods of Django.
So if it comes over as a string ("1000.0") it's gonna get pulled off. But this may really be a legitimate difference between how Python and JavaScript works. In Python declaring a value as 1000.0 will respect the trailing 0, but JavaScript will not.
Python
val=1000.0print(val)
# 1000.0
JavaScript
constval=1000.0;console.log(val);// 1000
So I think the question is should intcomma respect and mirror what comes after a decimal with a string input, and is there anything to be done for number inputs?
I don't know if I would call this a feature or a bug or really anything more than just a thing, but I've noticed that intcomma decides to round off decimals of zero, but not other numbers. For instance:
This is the case even when the user submits a value with an explicitly fixed decimal place.
I'm certain there is probably some good reason for this I'm unaware of, but I wanted to file this ticket since the second example above was not the behavior I expected as a user.
For what it's worth, it is also not the behavior of the old gods of Django.
The text was updated successfully, but these errors were encountered: