Page 1 of 1

Incorrect integer for value more than 999

Posted: Fri Aug 24, 2018 11:23 pm
by ghasembaghi

I have a filed with int(11) type in my database and can set value above 999 directly in database.
by in phpmaker(generated script) when i set a value above 999 i got this error: "Incorrect integer".


Re: Incorrect integer for value more than 999

Posted: Sat Aug 25, 2018 9:58 am
by arbei

Cannot simulate your problem, double check any validation code or code in Server Event and Client Script will change the value.

If you use thousand separator, check your locale file for your language id and make sure the user input (with thousand separator) matches your locale file.


Re: Incorrect integer for value more than 999

Posted: Sun Aug 26, 2018 10:42 pm
by ghasembaghi

I checked other int fields in other tables. This problem was also for them.
I do not use any of the thousands separators.

when i switch web interface to English (with parameter ?language=en in URL) everything is ok but when i switch back to Persian(Farsi) i got error.


Re: Incorrect integer for value more than 999

Posted: Mon Aug 27, 2018 10:58 am
by arbei

Can you post the settings for the locale of "Persian(Farsi)" here?


Re: Incorrect integer for value more than 999

Posted: Thu Sep 06, 2018 6:15 am
by polinevol

Hi,
I have the same problem.
I've found that unchecking "Server Side" in php settings of the project resolve the issue


Re: Incorrect integer for value more than 999

Posted: Sat Sep 08, 2018 8:32 pm
by Webmaster

You probably have wrong thousand separator (not matching user input) in your locale file. Double check your <lang>.json under C:\Program Files (x86)\PHPMaker <version>\locales.


Re: Incorrect integer for value more than 999

Posted: Thu May 16, 2019 8:24 pm
by ppinto

Function ew_CheckNumber doesn't work properly when $EW_THOUSANDS_SEP is a space character.
Edit phpfnXX.php, locate function ew_CheckNumber and change this:

$pat = '/^[+-]?(\d{1,3}(' . (($EW_THOUSANDS_SEP) ? ...

..to this:

$pat = '/^[+-]?(\d{1,3}(' . (($EW_THOUSANDS_SEP == "") ? ...

To make the changes permanent, edit phpfn.php inside the template file.