Make sure the number is stored as a proper number

This commit is contained in:
moodler 2006-04-20 04:07:50 +00:00
parent 59f3b71781
commit ec536d7a48

View File

@ -30,6 +30,20 @@ class data_field_number extends data_field_base {
parent::data_field_base($field, $data);
}
function update_content($recordid, $value, $name='') {
$content = new object;
$content->fieldid = $this->field->id;
$content->recordid = $recordid;
$content->content = (float)$value;
if ($oldcontent = get_record('data_content','fieldid', $this->field->id, 'recordid', $recordid)) {
$content->id = $oldcontent->id;
return update_record('data_content', $content);
} else {
return insert_record('data_content', $content);
}
}
function get_sort_sql($fieldname) {
global $CFG;