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.