Events Made Easy › Forums › Bug fixed or feature request implemented › Show Total Price Due as a currency value (float) instead of an integer
- This topic has 9 replies, 2 voices, and was last updated 11 years, 8 months ago by
Franky.
-
AuthorPosts
-
Sun 2 Feb 2014 at 02:32 #44152
Anonymous
InactiveHi,
Hate to be so picky, but wondered if you would consider modifying the way the amount due is show in an rsvp form. After completion, the total amount due is shown, but only as an integer so any “cents” amount is lost.
Would you consider making currency amounts as float instead of integer to reflect true balances due… like the following..
in Eme_rsvp.php
(Could we use:)
$ret_string .= sprintf(__(“The booking price in %s is: %01.2f”,’eme’), $event,$total_price);
(Instead of:)
$ret_string .= sprintf(__(“The booking price in %s is: %d”,’eme’), $event,$total_price);
I have been editing the function on every update to show my customers the proper amount, but it would be nice to avoid this update each time.
Thanks for considering.
Sun 2 Feb 2014 at 09:19 #51170Franky
Keymasteraccepted, but not with zero padding. It has become this:
http://plugins.trac.wordpress.org/changeset/849818
In fact, I should be using the php function money_format to be correct …
Mon 3 Feb 2014 at 08:17 #51171Anonymous
InactiveThanks Franky,
The result contains 6 significant digits (ie. $ 78.500000 ) and probably isn’t ideal for showing amounts due for people. Is there any way to at least restrict it to 2 sig digits in the change?
Mon 3 Feb 2014 at 10:06 #51172Franky
KeymasterOf course, there you’re correct. Zeroes at the end are useless, I need to find out where they come from 🙂 Probably a floating point calculation somewhere.
Mon 3 Feb 2014 at 11:08 #51173Anonymous
InactiveNo problem, thanks for the help!
Mon 3 Feb 2014 at 18:45 #51174Franky
KeymasterThis change will solve it I hope:
Mon 3 Feb 2014 at 21:00 #51175Anonymous
Inactivehmmm, not quite, now I am getting 0 returned for all costs except #_TOTALPRICE, none of the #_TOTALPRCICExx are being adding in. The email responders show blanks for the xx amounts…
Is there a reason that the %01.2f formatting cannot be used? It does seem to work.
Mon 3 Feb 2014 at 22:47 #51176Franky
KeymasterWell, apparently sprintf works different for you … but even testing locally with a floating point and echo yields weird results. For now it is as you suggested:
Mon 3 Feb 2014 at 22:52 #51177Anonymous
InactiveSo sorry for the trouble – thought this one would be easy.
Thanks again for your flexibility!
Mon 3 Feb 2014 at 23:23 #51178Franky
KeymasterNo prob, this is a php thingie caused by me 🙂
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.