I have made a small modification on reformatField function, file "productionnu2/common.php", to accepts any kind of decimal and separator numeric formats.
The idea is remove thousands "separator", based on textFormatsArray->separator, and replace the "textFormatsArray->decimal" to standard dot ("."). It is simple a can be used on any kind of number formats.
On:
Code: Select all
function reformatField($pValue, $pFormat,$addSingleQuotes = true){
// reformats value ready for insertion into database table
//originally formatted via rules in textFormatsArray()
...
Code: Select all
if (in_array($pFormat, array('14','15','16','17','18','19'))){ //---number with commas
return $sq . str_replace(',', '', $pValue) . $sq;
}
Code: Select all
if (in_array($pFormat, array('14','15','16','17','18','19'))){ //---number with commas
return $sq . str_replace($FORMAT[$pFormat]->decimal, '.', str_replace($FORMAT[$pFormat]->separator, '', $pValue)) . $sq;
}
Now, you can use your money regional settings on nuBuilder, like we have in Brazil:
Code: Select all
function textFormatsArray(){
//-----number formats
...
$format[16]->type = 'number';
$format[16]->format = '2';
$format[16]->decimal = ',';
$format[16]->separator = '.';
$format[16]->sample = '10.000,00';
$format[16]->phpdate = '';
$format[16]->sql = 'FORMAT(??,2)';
Evandro