Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:2.0fromwebmozart:issue2059
Nov 8, 2012

Conversation

@webmozart
Copy link
Contributor

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

fabpot added a commit that referenced this pull requestNov 8, 2012
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)
@fabpotfabpot merged commitdc80385 intosymfony:2.0Nov 8, 2012
@LogansUA
Copy link

LogansUA commentedSep 16, 2016
edited
Loading

@fabpot Hello. Can you implement same solution forPercentToLocalizedStringTransformer? Because now there is a problem with saving value inde locale.

The problem is that i can't save value with dot (onde locale), i.e.5.4.

@romaricdrigon
Copy link
Contributor

I confirm the bug is still there inPercentToLocalizedStringTransformer as of Symfony 3.2.7 :(

fabpot added a commit that referenced this pull requestOct 1, 2017
… 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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@webmozart@LogansUA@romaricdrigon@leapingbytes@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp