Zend Framework

Zend_Currency::toCurrency(): wrong display with use of "precision"

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.1
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Currency
  • Labels:
    None

Description

I've tried the following code:

{{
$currency = new Zend_Currency('de_DE');
echo $currency->toCurrency(34567.43212, array('precision' => 2));
echo $currency->toCurrency(34567.43212, array('precision' => 0));
}}

The first echo returns "34.567,43 €" as it should. The second echo should return "34.567 €" but it returns "34.567.00 €".
I guess with versions 1.7.x of ZF that problem didn't exists.

Issue Links

Activity

Hide
Master Surfer added a comment -

Hello Thomas,

okay I've tried the format-options in the array.
Like that:
{{echo $currency->toCurrency(34567.43212, array('precision' => 0, 'format' => '#,##0'))

Show
Master Surfer added a comment - Hello Thomas, okay I've tried the format-options in the array. Like that: {{echo $currency->toCurrency(34567.43212, array('precision' => 0, 'format' => '#,##0'))
Hide
Master Surfer added a comment -

Hello Thomas,

okay I've tried the format-options in the array.
Like that:
{{
echo $currency->toCurrency(34567.43212, array('precision' => 0, 'format' => '#,##0'))
}}
But I always get an error "'#,##0' is not a known locale." I've tried different format tags, but only "0" worked without an error. But the result was the same old mistake "34.567.00 €".
So how will I get "34.567 €"??

Show
Master Surfer added a comment - Hello Thomas, okay I've tried the format-options in the array. Like that: {{ echo $currency->toCurrency(34567.43212, array('precision' => 0, 'format' => '#,##0')) }} But I always get an error "'#,##0' is not a known locale." I've tried different format tags, but only "0" worked without an error. But the result was the same old mistake "34.567.00 €". So how will I get "34.567 €"??
Hide
Thomas Weidner added a comment -

Fixed with r15607

Show
Thomas Weidner added a comment - Fixed with r15607

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: