Dylanblitz
09-08-2009, 04:18 PM
Has anyone had problems with using the vb data cleaner stripping off numbers?
I have an app I built that uses the data cleaner to make sure my data is, well, clean :)
The function I use is
if ($_POST['rt']) { $rt = $vbulletin->input->clean_gpc('p', 'rt', TYPE_UNUM); }
It works fine if I pass a decimal number with a standard decimal separator.
I pass 5.643 and it gives me 5.643
If I have my language set to a non standard decimal separator, like a "," it will strip it.
I pass 5,643 and I get 5 back.
--------------- Added 1252448886 at 1252448886 ---------------
Okay, found a request on vb.com from Andreas from last year asking them to incorporate decimal/thousand separators for non english languages into the TYPE_UNUM cleaner. So to answer my own question, stripping off my extra numbers is just an undocumented feature until they decide to fix it :)
I have an app I built that uses the data cleaner to make sure my data is, well, clean :)
The function I use is
if ($_POST['rt']) { $rt = $vbulletin->input->clean_gpc('p', 'rt', TYPE_UNUM); }
It works fine if I pass a decimal number with a standard decimal separator.
I pass 5.643 and it gives me 5.643
If I have my language set to a non standard decimal separator, like a "," it will strip it.
I pass 5,643 and I get 5 back.
--------------- Added 1252448886 at 1252448886 ---------------
Okay, found a request on vb.com from Andreas from last year asking them to incorporate decimal/thousand separators for non english languages into the TYPE_UNUM cleaner. So to answer my own question, stripping off my extra numbers is just an undocumented feature until they decide to fix it :)