-
Notifications
You must be signed in to change notification settings - Fork 6
precision and scale suppport #1
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
Conversation
… right of the decimal point
… have. this can be used with scale to limit field values
|
@johnedmonds hey john, you can merge it to your branch and then update your pullrequest to Sam's repository. |
numeric/jquery.numeric.js
Outdated
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.
Can we add braces?
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.
Sure! I already did, take a look...
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.
I find the terms "scale" and "precision" to be fairly confusing. Can we rename them like
"precision" -> "digits"
"scale" -> "fractionalDigits"
(FYI you might find this question interesting: http://math.stackexchange.com/questions/64042/what-are-the-numbers-before-and-after-the-decimal-point-referred-to-in-mathemati)
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.
I think that scale and precision are rights.
Take a look at concept used in rails or databases for example:
http://millarian.com/programming/ruby-on-rails/precision-and-scale-for-ruby-on-rails-migrations/
http://msdn.microsoft.com/en-us/library/ms190476.aspx
http://stackoverflow.com/questions/5689369/what-is-the-difference-between-precision-and-scale-in-oracle
|
Sorry for taking so long to review this. It looks great now! Nice job! |
precision and scale suppport
|
No problem. Thanks! |
Renamed precision to scale, that represents the number of digits to the right of decimal point.
Added support to precision that represents the total number of digits.
eg:
$(".field").numeric({ precision: 4, scale: 2 }); //99.99