blib/lib/SVG/Estimate/Role/Round.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 17 CC 2 SCAR 13.9
CC
2
Cov
0%
round
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package SVG::Estimate::Role::Round;
2 $SVG::Estimate::Role::Round::VERSION = '1.0111';
3 use strict;
4 use Moo::Role;
5  
6 =head1 NAME
7  
8 SVG::Estimate::Role::Round - Round to the nearest thousandth
9  
10 =head1 VERSION
11  
12 version 1.0111
13  
14 =head1 METHODS
15  
16 =head2 round ( value [, significant ] )
17  
18 Rounds to the nearest 1000th of a unit unless you specify a different significant digit.
19  
20 =cut
21  
22 sub round {
23 my ($self, $value, $significant) = @_;
24 unless (defined $significant) {
25 $significant = 3;
26 }
27 return sprintf '%.'.$significant.'f', $value;
28 }
29  
30  
31 1;