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

Skip to content

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

Closed
@thewilkybarkid

Description

@thewilkybarkid

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...)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions