Index: computed_field.module =================================================================== RCS file: /cvs/drupal/contributions/modules/computed_field/computed_field.module,v retrieving revision 1.17.2.8 diff -u -r1.17.2.8 computed_field.module --- computed_field.module 31 Jul 2009 23:38:42 -0000 1.17.2.8 +++ computed_field.module 18 Sep 2009 17:11:14 -0000 @@ -65,12 +65,13 @@ '#title' => t('Data Type'), '#description' => t('The SQL datatype to store this field in.'), '#default_value' => !empty($field['data_type']) ? $field['data_type'] : 'varchar', - '#options' => array('int' => 'int', 'float' => 'float', 'varchar' => 'varchar', 'text' => 'text', 'longtext' => 'longtext'), + '#options' => array('int' => 'int', 'float' => 'float', 'decimal' => 'decimal' , 'varchar' => 'varchar', 'text' => 'text', 'longtext' => 'longtext'), '#required' => FALSE, ); $form['database']['data_length'] = array( '#type' => 'textfield', '#title' => t('Data Length'), + '#description' => t('For float and decimal data types, use the format "DIGITS,DECIMALS"'), '#default_value' => !empty($field['data_length']) ? $field['data_length'] : NULL, '#required' => FALSE, ); @@ -109,8 +110,9 @@ if ($field['data_type'] == 'longtext') { $columns['value']['type'] = 'text'; $columns['value']['size'] = 'big'; - } - else { + } else if ($field['data_type'] == 'decimal') { + $columns['value']['type'] = 'numeric'; + } else { $columns['value']['type'] = isset($field['data_type']) ? $field['data_type'] : 'varchar'; } // text and longtext should not have a length, so we ignore it