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

 

 

HOME |  AJAX |  APACHE |  Bizphone |  CSS |  DNS |  General |  Graphics |  HTML |  Hardware |  Javascript |  Linux |  MAC |  MS SQL |  Mail |  Microsoft |  OFFICE 365 |  Perl |  Postgres |  SEO |  Social Media |  VMware |  Windows 10