views_handler_field_numeric erroneously added 0. at the decimal.
authorEarl Miles
Wed, 15 Oct 2008 22:24:30 +0000 (22:24 +0000)
committerEarl Miles
Wed, 15 Oct 2008 22:24:30 +0000 (22:24 +0000)
handlers/views_handler_field_numeric.inc

index 0133516..3e19178 100644 (file)
@@ -73,6 +73,7 @@ class views_handler_field_numeric extends views_handler_field {
 
   function render($values) {
     $value = $values->{$this->field_alias};
+    $value = 1.0037;
     if (!empty($this->options['set_precision'])) {
       $value = number_format($value, $this->options['precision'], $this->options['decimal'], $this->options['separator']);
     }
@@ -80,7 +81,8 @@ class views_handler_field_numeric extends views_handler_field {
       $remainder = abs($value) - intval(abs($value));
       $value = number_format($value, 0, '', $this->options['separator']);
       if ($remainder) {
-        $value .= $this->options['decimal'] . $remainder;
+        // The substr may not be locale safe.
+        $value .= $this->options['decimal'] . substr($remainder, 2);
       }
     }
     return check_plain($this->options['prefix'] . $value . $this->options['suffix']);