I'm the maintainer of the Money CCK field module and one of the feature requests is support for currency symbols. While this is obviously a good thing to support, I think the right level to support this, is the Currency API module. After all, this module provides the list of currencies as well (currency_api_get_list()).

Would a patch that added a currency_api_get_symbol() function be accepted?

CommentFileSizeAuthor
#4 currency_symbols.patch10.09 KBwim leers

Comments

wim leers’s picture

For the record, this site provides a list of pretty much every currency symbol. And on Mac OS X Tiger at the least, all of them except AFN (Afghanistan) and UAH (Ukraine) render properly.

kbahey’s picture

Wim

I have been watching your contributions for a while, and because your history speaks for you, I granted you commit access to the CVS of the currency exchange module.

Go ahead and commit any new features you want, just keep me informed, and don't break backward compatibility.

Enjoy.

wim leers’s picture

What can I say? Thank you very much for the compliment! :) And thanks for the commit access.

I'll post the patches in the issue queue first, but as I understand it, I don't have to wait for you to review them?

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new10.09 KB

Several currencies were either no longer in use, or new ones had replaced them. Others were simply missing.

In the case of metals (gold, silver, etc.), I've simply kept the 3-letter codes. When there were different signs for singular and plural, I opted for the plural one.
For one currency (Afghanistani Afghani), there is no glyph included in Unicode yet, instead I chose "afghani" as the symbol (since there are no directions whatsoever).
For another one (Ukrainian Hryvnia), there is a Unicode glyph, but it's only available on the newest systems. Here I chose for the previously used notation: "грн.".
Finally, there are two non-decimal currencies (Madagascar's and Mauritania's) and one extremely unique notation (Tanzanian Shilling).

All special cases have comments.

Since there are some edge cases, I'm going to wait for your consent before committing this.

kbahey’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Go ahead and commit it to 5.x and HEAD.

wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

kenorb’s picture

What happened to currency_api_get_list() function ?
Where is the alternative?

xano’s picture