Closed (fixed)
Project:
Currency
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2010 at 08:33 UTC
Updated:
20 Mar 2011 at 16:01 UTC
Jump to comment: Most recent file
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.