Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What I want is a simple truncation of the number which would result in 34.578, not 34.579 .#!/usr/bin/perl -w use strict; my $n=34.57889; my $na=sprintf("%3.3f",$n); print "$n $na\n"; OUTPUT: 34.57889 34.579
|
|---|