[Perl] basic byte conversion script
I am very new to Perl and wrote this very simple to convert bytes to KB to MB to GB. So far it's working fine. But I tried to use "%g" in place of "%f" - which according to Learning Perl 4th ed. automatically
chooses float, integer etc. But it was not giving desired output. If anyone could tell me why I can't seem to use %g and also make some comments on the current code then that would be much appreciated. Here's the code Code:
#!/usr/bin/perl |
I think you'll find this page more informative: http://perldoc.perl.org/functions/sprintf.html
|
All times are GMT -5. The time now is 09:02 PM. |