Pages

Showing posts with label sprintf. Show all posts
Showing posts with label sprintf. Show all posts

Tuesday, August 6, 2013

Formatting Numbers in Perl


Introduction to Formatting Numbers 

Let us say that your program is calculating a number in decimal and you needed to print out leading zeros to it, how would you do it? If there is no need for formatting, you can just use the print command. 

my $a = 10.003403; print "$a";