-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fix precision of MoneyToLocalizedStringTransformer's divisions on transform() #26781
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -428,6 +428,7 @@ public function formatRoundingModeRoundHalfUpProvider() | |
// array(1.125, '1.13'), | ||
array(1.127, '1.13'), | ||
array(1.129, '1.13'), | ||
array(1020 / 100, '10.20'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure about that example? https://3v4l.org/5ZV3F does not confirm your observation. Should we use another example instead that allows to actually catch potential future regressions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xabbuh yes, you forgot to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed, thanks |
||
); | ||
} | ||
|
||
|
@@ -451,6 +452,7 @@ public function formatRoundingModeRoundHalfDownProvider() | |
array(1.125, '1.12'), | ||
array(1.127, '1.13'), | ||
array(1.129, '1.13'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
@@ -474,6 +476,7 @@ public function formatRoundingModeRoundHalfEvenProvider() | |
array(1.125, '1.12'), | ||
array(1.127, '1.13'), | ||
array(1.129, '1.13'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
@@ -498,6 +501,7 @@ public function formatRoundingModeRoundCeilingProvider() | |
array(-1.123, '-1.12'), | ||
array(-1.125, '-1.12'), | ||
array(-1.127, '-1.12'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
@@ -522,6 +526,7 @@ public function formatRoundingModeRoundFloorProvider() | |
array(-1.123, '-1.13'), | ||
array(-1.125, '-1.13'), | ||
array(-1.127, '-1.13'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
@@ -546,6 +551,7 @@ public function formatRoundingModeRoundDownProvider() | |
array(-1.123, '-1.12'), | ||
array(-1.125, '-1.12'), | ||
array(-1.127, '-1.12'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
@@ -570,6 +576,7 @@ public function formatRoundingModeRoundUpProvider() | |
array(-1.123, '-1.13'), | ||
array(-1.125, '-1.13'), | ||
array(-1.127, '-1.13'), | ||
array(1020 / 100, '10.20'), | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why first casting to string and then to float again ? The
*=
operator means that this is probably not a string already. What happens if you remove this ?