I have yet to find a way to change the decimal symbol, which is "." and the thousand symbol, which is "," to be switched around, we are using this module on a danish site and need it to display the results correctly, right now something that is actually just a decimal result, many read as being a thousand result.
This is a critical fix we need as the site we are using it on will go live on monday, please help!
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 764272-follow-up_currency_format_number-2.patch | 3.52 KB | amateescu |
| #6 | 764272-currency_format_number.patch | 1.47 KB | amateescu |
| #2 | currency_format_number_at_api_level.patch | 530 bytes | seutje |
| #1 | currency_format_number.patch | 493 bytes | seutje |
Comments
Comment #1
seutje commentedholas, attached patch checks for the presence of the format number module and if it exists, it will try to run the value through format_number with a decimal count of 2 (hardcoded)
it does this only in the submit handler for the calculator, so the actual API function remains untouched
(changing version as I doubt this will be committed to an already released version)
patch made against HEAD
Comment #2
seutje commentedsame thing on API level, still with hardcoded 2 decimals
Comment #3
Graloth commentedApplying those patches result in the calculation result always being 0,00 (, being decimal symbol now)nevermind, was my own mistake :)
Comment #4
kbahey commented@seutje
If you can expand the patch to allow a configurable number of digits to the right of the decimal point, that would be a great feature to have.
We kill 2 birds with one stone that way.
Comment #5
seutje commentedI'll see if I find some spare time for that, but can't make any promises to get it done before DC, already feel like I'm slacking on my core issues q.q
so should I bake this in the API call or only in the form submit? or should I have it simply throw a hook so others can easily fiddle with the formatting?
Comment #6
amateescu commentedHere is a patch that allows the user to specify the number of decimals returned in the result.
Comment #7
amateescu commentedFixed with http://drupal.org/cvs?commit=467060
Comment #9
amateescu commentedFollow-up patch for this issue. We should default $decimals to NULL in case the user wants the actual currency exchange result to process it later.
Edit: Also added some code clean-ups in this patch.
Comment #10
amateescu commentedCommited with 31c0354.