Branch Coverage

blib/lib/Format/Util/Numbers.pm
Criterion Covered Total %
branch 34 34 100.0


line true false branch
55 1 205 unless defined $input
60 204 1 if ($targ != 0)
61 104 100 $input >= 0 ? :
89 1 116 unless &looks_like_number($x)
91 2 114 if ($x < 0) { }
104 107 7 if ($x) { }
1 6 elsif (not scalar @segments) { }
109 108 6 if ($decimal_point) { }
5 1 elsif (defined $decimal_point) { }
114 1 4 if $last_num and $last_num > 0.5
138 110 1 if (&looks_like_number($text))
144 2 108 if $remove_decimal_for_ints
188 2 33 unless defined $val and $val =~ /$floating_point_regex/ and defined $$precisions{$type // 'unknown-type'} and defined $precisions->{$type}{$currency // 'unknown-type'}
230 2 21 unless defined $val and $val =~ /$floating_point_regex/ and defined $$precisions{$type // 'unknown-type'} and defined $precisions->{$type}{$currency // 'unknown-type'}
269 5 7 if not defined $val && $val =~ /$floating_point_regex/ or (not defined $precision && $precision =~ /^(?:1(?:[eE][-]?[0-9]+)?|0(?:\.0*1)?)$/ or $precision == 0)
308 1 9 unless defined $currency and defined $precisions->{'price'}{$currency // 'unknown-type'}
311 1 8 if $precisions->{'price'}{$currency} == 0