Skip to content

[Form] Field type number, misleading option "precision" actually handles, refers to "scale" #7383

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
groucho-zz opened this issue Mar 14, 2013 · 3 comments

Comments

@groucho-zz
Copy link

It is misleading to name the option "precision" when it actually refers to the
numbers after the decimal point, which should have been "scale" as it is declared
in the Entity for doctrine.

and generally in mysql :
http://dev.mysql.com/doc/refman/5.1/en/precision-math-decimal-changes.html

M is the maximum number of digits (the precision)
D is the number of digits to the right of the decimal point (the scale)

@jfsimon
Copy link
Contributor

jfsimon commented Apr 11, 2013

Renaming this option would be a huge BC break!

@groucho-zz
Copy link
Author

@jfsimon true, but it's still clearly incorrect, and a bit misleading.

@webmozart
Copy link
Contributor

Feel welcome to open a PR that introduces a new alias "scale" for "precision". Look at https://github.com/symfony/symfony/pull/6573/files to see how option aliasing works.

fabpot added a commit that referenced this issue Apr 3, 2015
This PR was merged into the 2.7 branch.

Discussion
----------

Deprecated precision option in favor of scale

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #7383
| License       | MIT
| Doc PR        | symfony/symfony-docs#5005

Scale is the number of digits to the right of the decimal point in a number, precision isn't. See the referenced ticket for more context.

Commits
-------

2a2f7e2 Deprecated precision option in favor of scale
@fabpot fabpot closed this as completed Apr 3, 2015
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

4 participants