http://www.perlmonks.org?node_id=11136982

sachin raj aryan has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks Not getting why amount is changing after padding with sprintf.Can anyone tell why this kind of output this line print "$amount i m checking amount before padding,\n"; --> output is 488715 this line print "$padamnt i m checking amount after padding,\n"; ---> output is 0000000000488714

sub amnt($amn) { my $amount=$_[0]; print "$amount i m checking amount before padding,\n"; my $padamnt = sprintf("%016d",$amount); print "$padamnt i m checking amount after padding,\n"; return $padamnt; }