[VPM] always floating point?
Peter Scott
Peter at PSDT.com
Mon Mar 31 16:58:09 CST 2003
At 02:44 PM 3/31/2003 -0800, Carl B. Constantine wrote:
>Actually, I don't think that would work in this case anyway.
>
>I've taken to reworking my code a bit so the values are always floating
>point. so instead of:
>
>my $rate = 7;
>
>I have,
>
>my $rate = 0.07;
>
>and not doing the /100 later in the report. I don't think this approach
>is as elegant, but I think it will work better over the long run for
>this particular project.
Bit hard to see how this could matter, but I don't know how you have to
interact with this other module. But in any case, I prefer to store
percentages as fractions, e.g., 0.07 instead of 7 anyway, then the
arithmetic always works without having to remember to divide. I only
have to remember to multiply by 100 when displaying it as a percentage,
which is better.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/
More information about the Victoria-pm
mailing list