=== modified file 'uc_product/views/uc_product.views.inc'
--- uc_product/views/uc_product.views.inc	2009-08-27 17:25:13 +0000
+++ uc_product/views/uc_product.views.inc	2009-09-29 20:55:49 +0000
@@ -47,6 +47,7 @@
     'field' => array(
       'handler' => 'uc_product_handler_field_price',
       'click sortable' => TRUE,
+      'float' => TRUE,
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
@@ -62,6 +63,7 @@
     'field' => array(
       'handler' => 'uc_product_handler_field_price',
       'click sortable' => TRUE,
+      'float' => TRUE,
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
@@ -77,6 +79,7 @@
     'field' => array(
       'handler' => 'uc_product_handler_field_price',
       'click sortable' => TRUE,
+      'float' => TRUE,
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
@@ -95,6 +98,7 @@
       ),
       'handler' => 'uc_product_handler_field_weight',
       'click sortable' => TRUE,
+      'float' => TRUE,
     ),
     'sort' => array(
       'handler' => 'views_handler_sort',
@@ -171,10 +175,10 @@
     ),
     'handlers' => array(
       'uc_product_handler_field_price' => array(
-        'parent' => 'views_handler_field',
+        'parent' => 'views_handler_field_numeric',
       ),
       'uc_product_handler_field_weight' => array(
-        'parent' => 'views_handler_field',
+        'parent' => 'views_handler_field_numeric',
       ),
       'uc_product_handler_filter_product' => array(
         'parent' => 'views_handler_filter_boolean_operator',

=== modified file 'uc_product/views/uc_product_handler_field_price.inc'
--- uc_product/views/uc_product_handler_field_price.inc	2009-07-11 19:04:32 +0000
+++ uc_product/views/uc_product_handler_field_price.inc	2009-09-29 20:57:47 +0000
@@ -9,29 +9,74 @@
 /**
  * Return a formatted price value to display in the View.
  */
-class uc_product_handler_field_price extends views_handler_field {
+class uc_product_handler_field_price extends views_handler_field_numeric {
+  function options(&$options) {
+    parent::options($options);
+
+    $options['format'] = 'uc_price';
+  }
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+
+    $options = $this->options;
+
+    $form['format'] =  array(
+      '#title' => t('Format'),
+      '#type' => 'radios',
+      '#options' => array(
+        'uc_price' => t('Ubercart price'),
+        'numeric' => t('Numeric'),
+      ),
+      '#default_value' => $options['format'],
+      '#weight' => 1,
+    );
+
+    // Change weight and dependency of the previous field on the parent numeric ones
+    $weight = 2;
+    foreach (array('set_precision', 'precision', 'decimal', 'separator', 'prefix', 'suffix') as $field) {
+      $form[$field]['#process'] = array('views_process_dependency');
+
+      if (is_array($form[$field]['#dependency'])) {
+        $form[$field]['#dependency'] += array('radio:options[format]' => array('numeric'));
+        $form[$field]['#dependency_count'] = count($form[$field]['#dependency']);
+      }
+      else {
+        $form[$field]['#dependency'] = array('radio:options[format]' => array('numeric'));
+      }
+
+      $form[$field]['#weight'] = ++$weight;
+    }
+  }
+
   function render($values) {
-    $context = array(
-      'revision' => 'themed',
-      'type' => 'product',
-      'class' => array(
-        'product',
-        $this->field,
-      ),
-      'field' => $this->real_field,
-      'subject' => array(
-        'node' => $values,
-      ),
-    );
-    $options = array('label' => FALSE);
-
-    $table_alias_len = strlen($this->table_alias);
-    foreach ($values as $key => $value) {
-      if (substr($key, 0, $table_alias_len) == $this->table_alias) {
-        $values->{substr($key, $table_alias_len + 1)} = $value;
+    if ($this->options['format'] == 'numeric') {
+      return parent::render($values);
+    }
+
+    if ($this->options['format'] == 'uc_price') {
+      $context = array(
+        'revision' => 'themed',
+        'type' => 'product',
+        'class' => array(
+          'product',
+          $this->field,
+        ),
+        'field' => $this->real_field,
+        'subject' => array(
+          'node' => $values,
+        ),
+      );
+      $options = array('label' => FALSE);
+
+      $table_alias_len = strlen($this->table_alias);
+      foreach ($values as $key => $value) {
+        if (substr($key, 0, $table_alias_len) == $this->table_alias) {
+          $values->{substr($key, $table_alias_len + 1)} = $value;
+        }
       }
+
+      return uc_price($values->{$this->field_alias}, $context, $options);
     }
-
-    return uc_price($values->{$this->field_alias}, $context, $options);
   }
 }

=== modified file 'uc_product/views/uc_product_handler_field_weight.inc'
--- uc_product/views/uc_product_handler_field_weight.inc	2009-07-01 21:08:44 +0000
+++ uc_product/views/uc_product_handler_field_weight.inc	2009-09-29 20:58:27 +0000
@@ -9,8 +9,53 @@
 /**
  * Return a formatted weight value to display in the View.
  */
-class uc_product_handler_field_weight extends views_handler_field {
+class uc_product_handler_field_weight extends views_handler_field_numeric {
+  function options(&$options) {
+    parent::options($options);
+
+    $options['format'] = 'uc_weight';
+  }
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+
+    $options = $this->options;
+
+    $form['format'] =  array(
+      '#title' => t('Format'),
+      '#type' => 'radios',
+      '#options' => array(
+        'uc_weight' => t('Ubercart weight'),
+        'numeric' => t('Numeric'),
+      ),
+      '#default_value' => $options['format'],
+      '#weight' => 1,
+    );
+
+    // Change weight and dependency of the previous field on the parent numeric ones
+    $weight = 2;
+    foreach (array('set_precision', 'precision', 'decimal', 'separator', 'prefix', 'suffix') as $field) {
+      $form[$field]['#process'] = array('views_process_dependency');
+
+      if (is_array($form[$field]['#dependency'])) {
+        $form[$field]['#dependency'] += array('radio:options[format]' => array('numeric'));
+        $form[$field]['#dependency_count'] = count($form[$field]['#dependency']);
+      }
+      else {
+        $form[$field]['#dependency'] = array('radio:options[format]' => array('numeric'));
+      }
+
+      $form[$field]['#weight'] = ++$weight;
+    }
+  }
+
   function render($values) {
-    return uc_weight_format($values->{$this->field_alias}, $values->{$this->aliases['weight_units']});
+    if ($this->options['format'] == 'numeric') {
+      return parent::render($values);
+    }
+
+    if ($this->options['format'] == 'uc_weight') {
+      return uc_weight_format($values->{$this->field_alias}, $values->{$this->aliases['weight_units']});
+    }
   }
 }

