in reply to Help with decimals

one more example...

If the number is 1368 and $bar is 3
then the result should be 1.368

if the number xxxxx and $bar is 2
then the result should be xxx.xx

Replies are listed 'Best First'.
Re: Re: Help with decimals
by rchiav (Deacon) on Jul 30, 2001 at 06:42 UTC
    Then you just want to do a..
    #!/usr/bin/perl -w use strict; my ($foo, $bar); $foo = 1500; $bar = 2; print $foo / (10 ** $bar) ."\n";
    Hope this helps..
    Rich