Issues

ZF-11641: Zend_Currency converts 1 to 10 EUR if LC_ALL is set to de_DE

Issue Type:

Bug

Created:

2011-08-03T16:12:36.000+0000

Last Updated:

2012-12-13T18:54:36.000+0000

Status:

Open

Fix version(s):

Reporter:

Michael Kühn (breiti)

Assignee:

Thomas Weidner (thomas)

Tags:

Zend_Currency

Zend_Locale

View_Helper

Related issues:

Attachments:

Description

Hi,

I got the following Problem:
If i call $this->currency(1) in a View-Script, it returns: '10,00 €' (which is obviously wrong, expected: '1,00 €').
If i change the locale-settings (see below for more Information) to en_US, $this->currency(1) returns '1,00 $' (which is good but i dont need USD).

If i remove the follwing line:
setlocale(LC_ALL, $localeString);
from my bootstrapping (pasted below), $this->currency(1) returns '1,00 €' and all is fine.

The static function normalize in Zend/Locale/Math.php seems to make the wrong conversion.

the problem is a combination of Zend_Locale_Math::round() and Zend_Locale_Math::normalize().
Zend_Locale_Math::round() adds a ".0" to full integer values or rounds float values to the given precision.
After this Zend_Locale_Math::normalize() gets called. With a locale setting that uses a "." as thousands sepecator, normalize() strips "."