Hi,

I'm working in Vietnamese and the prices are always showing in VND instead of ₫ (Dong) which is the symbol. Is there a way to change this? Is it a bug? In USD it's always the symbol showing which is $. The symbol is there in the commerce.currency.inc for Vietnamese but not used.

Then how can I change the separator to dot instead of comma? Is these documentation? I can't find.

Thanks for answer

CommentFileSizeAuthor
#4 1286554.vnd_.patch542 bytesrszrama

Comments

m_wiking’s picture

Component: Documentation » Commerce
rszrama’s picture

There's an FAQ for this: http://www.drupalcommerce.org/faq/currency-format

Incidentally, all it really recommends is that you come post an issue for your currency and provide some examples so we know how to format it properly. Can you type out a few full numbers as you would need them formatted? I need at least one number with a decimal value and one over a thousand.

m_wiking’s picture

Here is examples on how Dong should be displayed:

5.000₫
10.000₫
50.000₫
500.000₫

If you go in 1 mil you type in 1.000.000₫ and so on and so forth.

The hào (minor_unit) is now worth so little that it is no longer issued.

rszrama’s picture

Title: Currency symbol » Correct Vietnamese Dong currency format
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new542 bytes

This should do it then, right?

m_wiking’s picture

Category: feature » bug
Status: Needs review » Active

Thanks so much for this. I just tried the patch and it works. The only thing is that the ₫ should come directly after the numbers like this: 260.000₫

With this patch it's like this: 260.000 ₫

Is it possible to change?

I just looked in to the hook_commerce_currency_info(). Maybe I can use commerce_currency_format and call a custom callback and remove the space?

rszrama’s picture

Status: Active » Reviewed & tested by the community

Hmm, we can always remove that if it's not useful for any currency. I'm not sure why I implemented the space, so let's check with currencies like the Euro to see if it's even necessary.

m_wiking’s picture

I think your computer managed to change the format of the vietnamese character.

It should be like this: 'symbol' => 'đ',

Right now it got a underscore in it: 'symbol' => '₫',

rszrama’s picture

Title: Correct Vietnamese Dong currency format » Consider removing the space between a formatted price and the currency symbol
Status: Reviewed & tested by the community » Needs review

Ok, I fixed that and committed. I'll still see what we can do about commerce_currency_format(). Maybe we don't need that space between the number and the currency symbol for any currency.

m_wiking’s picture

Thanks, I saw that it was committed to the latest dev version of Commerce.

rszrama’s picture

Issue tags: +1.1 blocker

Let's get a good answer on this in the next week or two for the 1.1 release.

firfin’s picture

Hi,

Being Dutch and thus European I think I can chip in here. Europa is a collection of nations and so surprisingly ;) , there is no single standard. As far as I can tell the official Dutch spelling dictates the symbol (€ 5) before the amount. But in French the symbol comes after the amount (5 €).
Preferences of course stemming from how the original currency was spelled.

Both do require a space between the two though.
Then again, there are probably countries that don't use the space between the two.

I think this has to be a somewhat flexible setting.
Hope this helps.

BTW the same goes for the 'thousands' separator, this can be space, comma, or dot apparantly (depending on country)

olafkarsten’s picture

Hi, I will second firfin - both is possible in EU before and after, but both should have a space (though you will often see it without a space). Often letters (EUR) are used instead of € Symbol. So we should have a way to theme/set this in all possible variants. As a default setting I think, € 100.00 or EUR 100.00 - both would be okay. In short - in either way, we EUNA's (EU-Natives) ;) - need the space.

BTW: I haven't looked at this in Detail. Is there a way to theme/set this easy?

rszrama’s picture

Category: bug » feature
Status: Needs review » Fixed

It seems perhaps the best thing we can do is add additional formatting options for currencies to specify whether or not there should be spacing between the currency symbol / currency code and the price amount. To preserve the current behavior, it will default to a single space for each.

As to the question of a theme function... there isn't any right now, but it would probably be good to think about (for example, to apply nowrap to prices with spaces). For now you can just specify a custom format callback for your currencies and do what you need in there.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/c4df518

Automatically closed -- issue fixed for 2 weeks with no activity.