Problem with Numeric Field [message #3003] |
Tue, 19 June 2012 12:29 |
juanguilarte
Messages: 27 Registered: June 2012
|
Junior Member |
|
|
When I update a record (upd1) and the numeric fields has decimal point and are not edit, this numeric field are shift like it lost de decimal point (,).
My radicore version is 1.75
Example: 175,00 is convert to 17.500,00
if they are something wrong please let me know
Thank you in advance
|
|
|
|
|
Re: Problem with Numeric Field [message #3006 is a reply to message #3005] |
Wed, 20 June 2012 04:58 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I have tested this on my local PC and I cannot duplicate the problem. Input of '175000' or '175,000' is reformatted to '175000.00' for internal use, and changed to '175,000.00' when displayed on the screen.
The only way that this would be displayed as '175.000,00' is if you locale setting says that:
- decimal point is ',' (comma)
- thousands separator is '.' (period)
The formatNumber() and number_unformat() functions use the same locale settings, so I cannot see how they can get out of step.
Can you step through with your debugger and see what happens inside both of these functions?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
[Updated on: Thu, 31 July 2014 03:55] Report message to a moderator
|
|
|
|
Re: Problem with Numeric Field [message #3008 is a reply to message #3007] |
Wed, 20 June 2012 15:17 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Your locale (language = Spanish) was displaying the value "175,000.00" as "175.000,00", but because the field was set to 'noedit' the value was not being returned in the $_POST array. This meant that it was still set to "175,000.00" when it went through the number_unformat() function in the wrong format.
I've made a few tweaks to two scripts (see attached file). Can you let me know if it fixes your problem.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
[Updated on: Thu, 31 July 2014 03:54] Report message to a moderator
|
|
|
|