Float::Truncate - Ttruncate Float decimal length by special length
use Float::Truncate qw/truncate truncate_force/;
Float::Truncate is used for truncate float decimal length
use Float::Truncate qw/truncate truncate_force/; my $float = 1.556; print truncate( $float, 2 ); # output 1.56 print truncate_force( $float, 2 ); # output 1.55 # If not special length argument, will original float number. print truncate( $float ); # output 1.556
MC Cheung <mc.cheung@aol.com>
Copyright 2018- MC Cheung
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Float::Truncate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Float::Truncate
CPAN shell
perl -MCPAN -e shell install Float::Truncate
For more information on module installation, please visit the detailed CPAN module installation guide.