#13 SetData() - locale may cause data to be rejected

open
nobody
None
5
2010-03-23
2010-03-23
Anthon Pang
No

lmeyer reports that when the locale uses commas as a the radix character, the trim function converts numbers, e.g., 0.9, to a string "0,9", which then fails the is_numeric() test.

We can either check for is_numeric() before trim()'ing, or comment out the trim() altogether.

if(!is_numeric($x)) { $x = trim($x); }
if(!is_numeric($y)) { $y = trim($y); }

Discussion