[interchange-bugs] [rt.icdevgroup.org #349] Vend::Util::round_to_frac_digits() simplification

Anonymous via RT interchange at rt.icdevgroup.org
Mon Mar 19 15:47:34 UTC 2012


Mon Mar 19 15:47:34 2012: Request 349 was acted upon.
Transaction: Ticket created by guest
       Queue: Interchange
     Subject: Vend::Util::round_to_frac_digits() simplification
       Owner: Nobody
  Requestors: mark at overmeer.net
      Status: new
 Ticket <URL: http://rt.icdevgroup.org/Ticket/Display.html?id=349 >


round_to_frac_digits()  produces ".00" when called with (0, 2).  It also parses the integers incorrectly: in normal Perl "1." is a valid number, as is "+3", but "-" is not valid.

Nearly all of the function logic can be replaced with:

  printf "%.*f", $digist, $num;




More information about the interchange-bugs mailing list