1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

DibiTranslator: %f modifier converts value to number

This commit is contained in:
David Grudl
2010-05-19 17:14:12 +02:00
parent 286cd7bacd
commit 8b4cd4e689

View File

@@ -355,7 +355,7 @@ final class DibiTranslator extends DibiObject
if (is_string($value) && is_numeric($value) && strpos($value, 'x') === FALSE) {
return $value; // something like -9E-005 is accepted by SQL, HEX values are not
} else {
return $value === NULL ? 'NULL' : rtrim(rtrim(number_format($value, 5, '.', ''), '0'), '.');
return $value === NULL ? 'NULL' : rtrim(rtrim(number_format($value + 0, 5, '.', ''), '0'), '.');
}
case 'd': // date