Bug #5582 - sort by numerical field doesn't work properly with decimals; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-05-25 15:57:20 +00:00
parent 1a50a1f91e
commit 4df627dfbf
+2 -2
View File
@@ -48,8 +48,8 @@ class data_field_number extends data_field_base {
global $CFG;
switch ($CFG->dbtype) {
case 'mysql': // DECIMAL would be more accurate but only MySQL 5 supports it.
return 'CAST('.$fieldname.' AS SIGNED)';
case 'mysql': // string in an arithmetic operation is converted to a floating-point number
return '('.$fieldname.'+0.0)';
default:
return 'CAST('.$fieldname.' AS REAL)';