Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot#5941
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…and dot as decimal separator, if possible
This PR was merged into the 2.0 branch.Commits-------dc80385 [Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possibleDiscussion----------[Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dotBug fix: yesFeature addition: noBackwards compatibility break: noSymfony2 tests pass: yesFixes the following tickets:#2059Todo: -License of the code: MITDocumentation PR: -The behaviour after this is as follows:* if "grouping" (thousands separators) is disabled (the default) * you may use comma and dot as decimal separator in all locales* if "grouping" is enabled * you may use a comma as decimal separator in all locales where the thousands separator is not a comma (e.g. "de", "fr", but not "en") * you may use a dot as decimal separator in all locales where the thousands separator is not a dot (e.g. "en", "fr", but not "de")If the form is displayed again, all numbers are displayed in your locale, regardless of which decimal separator you used for input.**Example 1 (locale "fr"):*** you enter: "1234.56"* after submission: * without grouping: "1234,56" * with grouping: "1 234,56"**Example 2 (locale "en"):*** you enter "1234,56"* after submission: * without grouping: "1234.56" * with grouping: error (because "," is the thousands separator; "1234,560" would have been accepted)
LogansUA commentedSep 16, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fabpot Hello. Can you implement same solution for The problem is that i can't save value with dot (on |
romaricdrigon commentedApr 28, 2017
I confirm the bug is still there in |
… both comma and dot as decimal separator, if possible (aaa2000)This PR was squashed before being merged into the 2.7 branch (closes#22586).Discussion----------[Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible| Q | A| ------------- | ---| Branch? | 2.7 <!-- see comment below -->| Bug fix? | yes-ish| New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files -->| BC breaks? | no| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->| Tests pass? | yes| Fixed tickets | <!-- #-prefixed issue number(s), if any -->| License | MIT<!--- Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too).- Features and deprecations must be submitted against the master branch.- Please fill in this template according to the PR you're about to submit.- Replace this comment by a description of what your PR is solving.-->Implements the same behaviour that `NumberToLocalizedStringTransformer` in order to accept both comma and dot implemented in#5941Commits-------f96a7f8 [Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:#2059
Todo: -
License of the code: MIT
Documentation PR: -
The behaviour after this is as follows:
If the form is displayed again, all numbers are displayed in your locale, regardless of which decimal separator you used for input.
Example 1 (locale "fr"):
Example 2 (locale "en"):