On May 25, Barry Robison wrote:
> You may want to check out http://www.opensales.org/html/source.shtml,
> rather than starting from scratch .. I haven't used it, but it's
> a Perl based GPL commerce solution.

Every time I look at this code, my brain hurts.

Especially crap like this:

## nicedecimals( $s ) : $s;
#
sub nicedecimals {
   my( $x,$y,$a,$b,$r,$i );
   $i=$_[0];

   ( $left,$right ) = split /\./, $i;
   $left="0" if (!$left);
   $right="00" if (!$right);
   $right.="0" if (length($right)==1);
   $right = substr $right, 0, 2;
   return "$left.$right";

} #/nicedecimals

Is there something this does that 'sprintf "%01.2f", $var' doesn't?
I guess it truncates rather than rounding the last digit, but I
have serious doubts that is intentional.

Jim

Reply via email to