Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] IntegerToLocalizedStringTransformer::reverseTransform() should round #8473

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

Closed
thewilkybarkid opened this issue Jul 11, 2013 · 0 comments

Comments

@thewilkybarkid
Copy link
Contributor

IntegerToLocalizedStringTransformer::reverseTransform() causes the input to be cast to an integer without respecting the rounding_mode option.

So an input of 1233.5 with ROUND_UP causes the data/view data to become int(1233) rather than int(1234).

The NumberToLocalizedStringTransformer doesn't have this problem as it stores the data as an unrounded double, so doing the same with a precision of 0 causes the data to be double(1233.5) and the view data is then correctly int(1234).

(The docs also state that there's a precision option for the integer type, which doesn't make a lot of sense...)

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

No branches or pull requests

2 participants