Zend Framework

Zend_Measure rounds with default precision of 2 on convertTo

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.6.0
  • Component/s: Zend_Measure
  • Labels:
    None

Description

When converting one measure to another with a precision higher than 2
the precision doesn't seem to be taken into account and digits after the "." are always zeroed.

$locale = new Zend_Locale('en_US');

$number = new Zend_Measure_Length(12.3456,Zend_Measure_Length::STANDARD,$locale);
$number->convertTo('CENTIMETER',4);

echo $number->getValue(4);

returns: 1235.00

changing line 130 in Measure/Abstract.php to:
$value = $this->getValue(4);
works arround the problem.

Activity

Hide
Thomas Weidner added a comment -

Fixed with r9795

Show
Thomas Weidner added a comment - Fixed with r9795
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: