[ic] [interchange-bugs] [rt.icdevgroup.org #349] Vend::Util::round_to_frac_digits() simplification
Peter
peter at pajamian.dhs.org
Mon Mar 19 22:38:19 UTC 2012
CCing the userlist because I want Mike to see this.
On 20/03/12 04:47, Anonymous via RT wrote:
> 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;
Agreed, except it needs to be sprintf.
Mike, is there any reason to not make this change?
Peter
More information about the interchange-users
mailing list