How To Format The Number Of Decimal Places In Perl

1 2 |
my $number = 123.45; printf("%.3f", $number); |
Outputs: 123.450
1 2 |
my $number = 123.45; printf("%.3f", $number); |
Outputs: 123.450
Categories: How-To's, Technology Tags: Decimal, Float, Floating, Floating Point, Format, howto, Number, perl, printf, Round, Rounding, sprintf, tips
Copyright © 2005-2025 Eric Michael Stone | Random Thoughts, Whims and Fancies…. Powered by WordPress
Leave Your Comment
All fields marked with "*" are required.