-
Notifications
You must be signed in to change notification settings - Fork 5
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
Problem with small numbers ? #9
Comments
Mouish, Thanks for the heads up - I will look for a fix. Bob On 12/9/2012 5:53 AM, Mouish wrote:
|
Mouish, The problem is autoNumeric treats the input as a string so is remove non If you use a string that represents a number That may not be practical in your case, so I found a solution and can Let me know and I will help. Bob On 12/9/2012 5:53 AM, Mouish wrote:
|
Bob, First of all, thanks for your time. I use version 1.7.5.
My problem is solved, this solution is very satisfying in my case (and I think in many). About this : Yes, but it's not very useful because .toString() brings the problem back :
The problem happens only with numbers < 0.000001 :
I think the proper patch would be to modify autoNumeric to deal this numbers like "-1.257814e-7", but it seams quite complicated (adapt all regexp and so...), and not very useful as these numbers will probably finally be formatted "0.00" by autoNumeric... So maybe my patch is not so bad, and anyway much better than getting 17.00 (or whatever) instead of 0.00, which is a real bug. Hope this help. |
Mouish, I was think of approaching this from a different angle. Consider the
the e//xponential notation to decimal "1.0000001" then use toString() Either way I am glad you found a solution. Best regards, Bob On 12/16/2012 4:24 PM, Mouish wrote:
|
Good idea, but take care of negative numbers : (0.000000001+1).toString().substring(1) => ".000000001" |
M. Yes I already addressed that by doing this - i should have emailed you
Bob On 1/4/2013 8:38 AM, Mouish wrote:
|
M. I also made a couple other changes to version 1.8.0 http://www.decorplanit.com/plugin/autoNumeric-1.8.0.htm Hope to release this weekend. Bob On 1/4/2013 8:38 AM, Mouish wrote:
|
Hi,
When I do this :
$("#field").autoNumericSet(.000001);
I get 0.00 in field, all right.
But when I do this :
$("#field").autoNumericSet(.0000001);
I get 17.00 !!! in field...
Yep, .0000001 = 1e-7 ... which becomes 17 !
The text was updated successfully, but these errors were encountered: