Closed (fixed)
Project:
Money field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2008 at 22:17 UTC
Updated:
25 Oct 2010 at 11:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
wim leersAgreed.
Comment #2
wim leersSince 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.
Comment #3
wim leersComment #4
Gidgidonihah commentedUnfortunately, 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:
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
Comment #5
wim leersWon't be implemented in the Drupal 5 version, which is now a bugfix-only branch.
Comment #6
markus_petrux commentedLet'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?
Comment #7
wim leersJust contact the Currency API maintainer, he's open to change. I've got co-maintainership there as well.
Comment #8
markus_petrux commentedHere'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.
Comment #9
wim leersOf 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 :)
Comment #10
markus_petrux commentedOk, 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.
Comment #11
markus_petrux commentedYep! Look at the following :)
#329052: decimal count for currencies
Awaking the issue so I don't forget it.
Comment #12
pauldawg commentedJust 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?
Comment #13
wim leersThe 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.
Comment #14
pauldawg commentedWhat a great response! :) Thanks!
Comment #15
markus_petrux commentedWell, 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.
Comment #16
wim leersmarkus:
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?
Comment #17
markus_petrux commentedWim,
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.
Comment #18
markus_petrux commentedWell, 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.
Comment #20
drugasy commentedIn Madagascar, we use Ariary (Ar)
Comment #21
markus_petrux commented@drugasy: You may want to post a feature request to the Currency API module:
http://drupal.org/project/currency
Comment #22
pobster commentedI've attempted to achieve currency formatting here: http://drupal.org/project/format_currency
It's in pretty early stages feature-wise though...
Pobster