Events Made Easy Forums Bug fixed or feature request implemented Show Total Price Due as a currency value (float) instead of an integer

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #44152
    Anonymous
    Inactive

    Hi,

    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.

    #51170
    Franky
    Keymaster

    accepted, 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 …

    #51171
    Anonymous
    Inactive

    Thanks 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?

    #51172
    Franky
    Keymaster

    Of 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.

    #51173
    Anonymous
    Inactive

    No problem, thanks for the help!

    #51174
    Franky
    Keymaster

    This change will solve it I hope:

    http://plugins.trac.wordpress.org/changeset/850745

    #51175
    Anonymous
    Inactive

    hmmm, 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.

    #51176
    Franky
    Keymaster

    Well, 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:

    http://plugins.trac.wordpress.org/changeset/850900

    #51177
    Anonymous
    Inactive

    So sorry for the trouble – thought this one would be easy.

    Thanks again for your flexibility!

    #51178
    Franky
    Keymaster

    No prob, this is a php thingie caused by me 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top