lib/SVG/Estimate/Role/Round.pm

filter: Statementstmt 100% 12 / 12 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 94.4% 17 / 18 CC 2 SCAR 4.1
CC
2
Cov
93%
round
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« lib/SVG/Estimate/Role/EndToPoint.pm ↑ Summary lib/SVG/Estimate/Shape.pm »
1 package SVG::Estimate::Role::Round;
2 31 $SVG::Estimate::Role::Round::VERSION = '1.0111';
3 31 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 31 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 81 ▶ my ($self, $value, $significant) = @_;
Subroutine round: called CC=2 SCAR=7.0
Pod documented
24 81 ▶ unless (defined $significant) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $significant) 81 0 81
25 81 $significant = 3;
26 }
27 81 return sprintf '%.'.$significant.'f', $value;
28 }
29  
30  
31 31 1;
« lib/SVG/Estimate/Role/EndToPoint.pm ↑ Summary lib/SVG/Estimate/Shape.pm »