www.fromthevalley.com.au

sprintf USE

How to use sprintf to force 4 dec places.

 

my $tp = '24.3';
$tp  = sprintf( "%.4f", $tp );



print "***".$tp."***\n";


Output is 24.3000

 

 

HOMEAJAXAPACHEBizphoneCSSDNSGeneralGraphicsHTMLHardwareJavascriptLinuxMACMS SQLMailMicrosoftOFFICE 365PerlPostgresSEOSocial MediaVMwareWindows 10