Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2009 at 14:57 UTC
Updated:
21 Apr 2009 at 23:00 UTC
This patch fixes the numeric field formatter when handling negative values. Under certain circumstances, the following code can alter the value of a negative numeric value rather than simply adjust its display:
$value = number_format(floor($value), 0, '', $this->options['separator']);
If $value is -109.3, floor() will return -110, not -109 as desired.
This patch fixes this issue by adding a check for whether the value in question is positive or negative and using ceil() for negative values.
| Comment | File | Size | Author |
|---|---|---|---|
| views_numeric_negative_format.patch.txt | 1.02 KB | yhahn |
Comments
Comment #1
merlinofchaos commentedSilly PHP really should have a truncate function. :P Thanks. Committed.