The default prefix and suffix format is "X yyyy Z". That is, the prefix, a space, the amount, a space and the suffix. Some currencies require that space, and some do not. This space should be optional.

Additionally, when the space is used, it should be a non-breaking space so that in certain instances it will not be forced to a new line, but kept together.

Thanks.

CommentFileSizeAuthor
#4 currency.txt8.84 KBGidgidonihah

Comments

wim leers’s picture

Assigned: Unassigned » wim leers

Agreed.

wim leers’s picture

Component: User interface » Code
Assigned: wim leers » Unassigned
Status: Active » Postponed

Since it depends on the currency if a space is necessary or not, and it'll be a lot of work to add the hints for this to the Currency API module, I'm going to postpone this feature.
It'd be very useful if you could list these properties for each (or as many as you can) currency:
- position (i.e. prefix or postfix)
- spacing (i.e. no space or space, or perhaps even more possibilities?)

I've made the current formatters use non-breaking spaces btw :) Thanks for that excellent suggestion.

wim leers’s picture

Title: create an optional non-breaking space in prefix and suffix » Format currencies according to their own custom, add hints for this to the Currency API
Gidgidonihah’s picture

StatusFileSize
new8.84 KB

Unfortunately, I couldn't find any listing of the proper formatting for a majority of languages. I did find some information but not all I wanted. I did not get the information for spacing. It seems we'll have to find examples of that on an individual basis. I had assumed we would set the spacing in the admin section, rather than per currency.

For the other currencies, 2 good starting places for anyone that wants to take a moment and contribute to the list are:
http://en.wikipedia.org/wiki/Currency_sign
http://www.xe.com/symbols.php

I have attached an XML file (saved as txt as xml is not allowed) with most of the info for the listed currencies in the following format:

<option iso="USD" currency-symbol="$" decimals="2" decimal-separator="." grouping-separator="," symbol-placement="before">US Dollars</option>

Austrian Schillings
Australian Dollars
Barbados Dollars
Belgian Francs
Bulgarian Lev
Bermudian Dollars
Bahamian Dollars
Canadian Dollars
Swiss Francs
Chilean Pesos
Chinese 'Yuan' Renmimbi
Czech Koruna
Cyprus Pounds
German Marks
Danish Kroner
Algerian Dinars
Egyptian Pounds
Spanish Pesetas
Euro
Finnish Markka
Fijian Dollars
French Francs
British Pounds
Greek Drachmas
Hong Kong Dollars
Hungarian Forint
Indonesian Rupiah
Irish Punt
Israeli New Shekels
Indian Rupees
Icelandic Krona
Italian Lira
Jamaican Dollars
Jordanian Dinar
Japanese Yen
North Korean Won
South Korean Won
Lebanese Pounds
Luxembourg Francs
Mexican New Pesos
Malaysian Ringgit
Dutch Guilders
Norwegian Kroner
New Zealand Dollars
Philippines Peso
Pakistani Rupees
Polish Zloty
Portuguese Escudo
Romanian Leu
Saudi 'Arabian' Riyal
Sudan Pound
Swedish Krona
Singapore Dollars
Thai Baht
Turkish Lira
Trinidad and Tobago Dollars
Taiwan Dollars
US Dollars
Venezuelan Bolivar
South African Rand
Zambian Kwacha

wim leers’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

Won't be implemented in the Drupal 5 version, which is now a bugfix-only branch.

markus_petrux’s picture

Status: Postponed » Active

Let's see if we can address this issue before launching 6.x-1.x.

@Gidgidonihah: if you can take a look at the Drupal 6 version of the module, you'll see that's pretty easy to theme the output of money fields. You can override the theme function and code your own logic to display the number the way you wish. Does that solution work for you?

If not, well... since Money CCK field relies on Currency API, another approach would be to ask in their issues queue if they could extend the API with this addicional information, so we could just use whatever they add easilly.

Any other approach?

wim leers’s picture

Just contact the Currency API maintainer, he's open to change. I've got co-maintainership there as well.

markus_petrux’s picture

Here's another source of information for this:

http://www.unicode.org/reports/tr35/tr35-11.html

@Wim: do you think this issue could be transfered to the Currency API queue? ...or maybe someone open a feature request there?

PS: I'm going to create a stable release for CCK money now, without this feature.

wim leers’s picture

Priority: Normal » Minor
Status: Active » Postponed

Of course, please don't let this feature request stop you from doing that. This is a VERY VERY low priority issue (marked as such now), because how many users do we have in Madagascar and Mauritania? Chances are that that's close to zero. We'll hear from them when that's a false statement :)

markus_petrux’s picture

Status: Postponed » Closed (won't fix)

Ok, then I would say "won't fix" until we can retrieve additional information from the Currency API. Please, open a feature request to the other issues queue. Then this one can be awaken again.

markus_petrux’s picture

Status: Closed (won't fix) » Postponed

Yep! Look at the following :)

#329052: decimal count for currencies

Awaking the issue so I don't forget it.

pauldawg’s picture

Just wanted to add one basic comment here because surprisingly I do not see it as an open issue... forget Madagascar and Mauritania, what about USA? In the US the Dollar sign ($) is supposed to go on the left, with no space in between it and the value ($299.99). However, in Money CCK, the display of the symbol is on the right following a space. (299.99 $). Perhaps this example would be enough to push this feature up in the priority list? While the points being debated in #329052: decimal count for currencies about theming the currency format might be useful, it does seem strange that we are reluctant to program in "standards". After all, although there might be some variants, there certainly is a standard for every currency, and a good currency formatting tool should attempt to implement these standards, no?

wim leers’s picture

The formatters allow you to put the symbol on the left or on the right, as you please. Typically you decide where to place the currency sign based on the custom in a given country (at least that seems to be the custom in Belgium). That's why we often still write "100 EUR" instead of "EUR 100". The latter is the official EUR-formatting, the former is how we always wrote monetary amounts in Belgium in the past.

Since you're AFAIK the first to request this, or at least one of the few, I think the approach I/we took was the right *initial* one :) Which doesn't mean that we shouldn't support your approach at all, of course.

Just trying to add the right nuance to the issue… markus_petrux will give a definite answer.

pauldawg’s picture

What a great response! :) Thanks!

markus_petrux’s picture

Well, I would like to see the extension to the currency api mentioned in #11 applied, then we could use that data to extend the settings of the money fields, so that we could ley site admins define formatter options such as "display currency on the right", "display currency on the left" or "use standard placement". The later would use currency api data.

But we need that patch applied, at least to their -dev branch.

wim leers’s picture

markus:

1) contact kbahey, I think he'd give you commit access. I got it too when I started this module.
2) is it now finally possible to have *settings* for formatters in CCK for D6?

markus_petrux’s picture

Wim,

1) I just sent a note to Khalid. Let's see...
2) Nope, but I could provide that in the widget settings screen. I think it's a generic option that might not be necessary to change from context to context, and inn that case, there's still the possibility to override the theme function. Well, I think that would cover the issue.

markus_petrux’s picture

Status: Postponed » Fixed

Well, I have made some changes to the DEV version of the module.

The widget settings fieldset (not per field, but per instance options) contains a couple more options:

1) Currency display mode: it has been extended with several options to allow you to choose which parts of the money field need to be displayed: symbol + amount, symbol + amount + code, and so on...

2) Decimals display mode: New option. It allows you to choose from where to grab the precision of the amount at display time. It can be taken from the field precision, or from the standard currency format, which is taken from the recently extended currency api, see #329052: decimal count for currencies.

The list of available currencies displayed on the widget settings form includes de number of decimals per each currency between square brakets. This feature is available only when the latest currency_api is installed. BTW, it provides a hook_update_N() implementation to migrate widget options for existing fields.

I think this covers many use cases. The rest... can be implemented overridding the generic theme function (this is at the very bottom of the money.module file).

Feel free to reopen if there's anything I have missed. ;-)

PS: I think there will be a new release of CCK soon... then I plan to release money field.

Status: Fixed » Closed (fixed)

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

drugasy’s picture

In Madagascar, we use Ariary (Ar)

markus_petrux’s picture

@drugasy: You may want to post a feature request to the Currency API module:

http://drupal.org/project/currency

pobster’s picture

I've attempted to achieve currency formatting here: http://drupal.org/project/format_currency

It's in pretty early stages feature-wise though...

Pobster