Zend Framework

No space between value and symbol (solved in 1.9, but it's back)

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not an Issue
  • Affects Version/s: 1.10.6
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Currency
  • Labels:
    None

Description

I noted this bug in 1.10, then i saw a solved issue for this in 1.9, but i updated to 1.10.6 and the bug still exists.

$currency = new Zend_Currency(array('value'=>100));
print $currency; //Prints '$100.00' - correct is '$ 100.00'

$currency = new Zend_Currency(array('value'=>100));
$currency->setFormat(array('display' => Zend_Currency::USE_NAME));
print $currency; //Prints 'US Dollar100.00' - correct is 'US Dollar 100.00'

Activity

Hide
Thomas Weidner added a comment -

As you are referring to US DOLLAR and did not gave additional information I must expect that you are using en_US as locale and therefor USD as regional currency.

According to CLDR the locale en_US refers to the locale en without additional information.

The locale en defines currency representations as "¤#,##0.00;(¤#,##0.00)"
This means that a value like 1000 would be represented as
"$1,000.00".
When en would be represented with a space between currency and number format it would be "¤ #,##0.00" as it is defined in several other locales.

When you want to have a output which is different to the represenation from CLDR you must define your own output format.

Therefor closing as non-issue.

Show
Thomas Weidner added a comment - As you are referring to US DOLLAR and did not gave additional information I must expect that you are using en_US as locale and therefor USD as regional currency. According to CLDR the locale en_US refers to the locale en without additional information. The locale en defines currency representations as "¤#,##0.00;(¤#,##0.00)" This means that a value like 1000 would be represented as "$1,000.00". When en would be represented with a space between currency and number format it would be "¤ #,##0.00" as it is defined in several other locales. When you want to have a output which is different to the represenation from CLDR you must define your own output format. Therefor closing as non-issue.
Hide
Leandro Rodrigues Chaves added a comment -

Ok, i used "en_US" just to give an example, because i did think the output was wrong. If you said there is no space between number and symbol, that's ok for me. However, between currency's name and value should be a space, ain't? Is "US Dollar100.00" correct? Is this output usual?

My real problem is with "pt_BR". In Brazil, the correct is to be a space betwen symbol or currency's name and value.

$currency = new Zend_Currency(array('value'=>100));
print $currency; //Prints 'R$100,00' - correct is 'R$ 100,00'

$currency = new Zend_Currency(array('value'=>100));
$currency->setFormat(array('display' => Zend_Currency::USE_NAME));
print $currency; //Prints 'Real brasileiro100,00' - correct is 'Real brasileiro 100,00'

Show
Leandro Rodrigues Chaves added a comment - Ok, i used "en_US" just to give an example, because i did think the output was wrong. If you said there is no space between number and symbol, that's ok for me. However, between currency's name and value should be a space, ain't? Is "US Dollar100.00" correct? Is this output usual? My real problem is with "pt_BR". In Brazil, the correct is to be a space betwen symbol or currency's name and value. $currency = new Zend_Currency(array('value'=>100)); print $currency; //Prints 'R$100,00' - correct is 'R$ 100,00' $currency = new Zend_Currency(array('value'=>100)); $currency->setFormat(array('display' => Zend_Currency::USE_NAME)); print $currency; //Prints 'Real brasileiro100,00' - correct is 'Real brasileiro 100,00'
Hide
Thomas Weidner added a comment -

The locale "pt_BR" defines no informations. It degrades to "pt".
The locale "pt" defines a currency representation of "¤#,##0.00;(¤#,##0.00)".

So also for "pt" no space is defined between currency symbol and currency value. This is regardless of currency symbol, currency abbreviation or currency name.

When you want to use a space then set your own name which includes a space or use your own currency format.

Therefor keeping issue closed.

Show
Thomas Weidner added a comment - The locale "pt_BR" defines no informations. It degrades to "pt". The locale "pt" defines a currency representation of "¤#,##0.00;(¤#,##0.00)". So also for "pt" no space is defined between currency symbol and currency value. This is regardless of currency symbol, currency abbreviation or currency name. When you want to use a space then set your own name which includes a space or use your own currency format. Therefor keeping issue closed.
Hide
Leandro Rodrigues Chaves added a comment -

Brazil is not Portugal! Each country has its own culture! A space between symbol and value is the usual, at least in Brazil. If some organism defines a non-usual standard, it shouldn't be a standard, and the organism is wrong, ain't? Anyway, i know ZF team is not the responsible for these locale standards. But, at least, you could provide us with the possibility to define we want use the space, by creating a constant like Zend_Currency::USE_SPACE_BETWEEN_SYMBOL_AND_VALUE (true or false), that could be used in toCurrency() method. Can you consider this request?

Show
Leandro Rodrigues Chaves added a comment - Brazil is not Portugal! Each country has its own culture! A space between symbol and value is the usual, at least in Brazil. If some organism defines a non-usual standard, it shouldn't be a standard, and the organism is wrong, ain't? Anyway, i know ZF team is not the responsible for these locale standards. But, at least, you could provide us with the possibility to define we want use the space, by creating a constant like Zend_Currency::USE_SPACE_BETWEEN_SYMBOL_AND_VALUE (true or false), that could be used in toCurrency() method. Can you consider this request?
Hide
Thomas Weidner added a comment -

There is no differece for the currency definition between the locale brazil and the locale portuguese.

This has nothing to do with country or culture... the fact is simply that one definition says "no difference to my root" as both are identical.

As mentioned before, ZF itself allows you already to define your own standard very easily. Look at the available properties of Zend_Currency. This is nothing which has to be considered as it's already supported.

Show
Thomas Weidner added a comment - There is no differece for the currency definition between the locale brazil and the locale portuguese. This has nothing to do with country or culture... the fact is simply that one definition says "no difference to my root" as both are identical. As mentioned before, ZF itself allows you already to define your own standard very easily. Look at the available properties of Zend_Currency. This is nothing which has to be considered as it's already supported.
Hide
Leandro Rodrigues Chaves added a comment -

So, ZF team could consider that we have a bit of confusion here. Maybe the lack of a space between symbol and value doesn't represent a big pratical problem, but, although it's also a standard for the currency definitions, the lack of a space between currency's name and value doesn't make sense. I can't really see anywhere 'US Dollar100.00' can be normal, because they are separated words.

Show
Leandro Rodrigues Chaves added a comment - So, ZF team could consider that we have a bit of confusion here. Maybe the lack of a space between symbol and value doesn't represent a big pratical problem, but, although it's also a standard for the currency definitions, the lack of a space between currency's name and value doesn't make sense. I can't really see anywhere 'US Dollar100.00' can be normal, because they are separated words.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: