blib/lib/WWW/Shopify/Liquid/Filter/MoneyWithoutTrailingZeros.pm

filter: Statementstmt 58.8% 10 / 17 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 13 / 26 CC 3 SCAR 18.7
CC
3
Cov
48%
operate
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« blib/lib/WWW/Shopify/Liquid/Operator.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Filter/Keys.pm »
1 #!/usr/bin/perl
2 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package WWW::Shopify::Liquid::Filter::MoneyWithoutTrailingZeros;
6 30 ▶use base 'WWW::Shopify::Liquid::Filter::Money';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 sub operate {
8 0 ▶ return undef unless $_[2];
Subroutine operate: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $_[2] 0 0 0
9 0 my $format = $_[1]->{shop}->{money_format};
10 0 ▶ $format = '$ {{ amount }' unless $format;
Branch: 1 branch
BranchTrueFalseTotal
unless $format 0 0 0
11 0 my $amount = sprintf('%.2f', $_[2] / 100.0);
12 0 $format =~ s/\{\{\s*amount\s*\}\}/$amount/;
13 0 $format =~ s/[\.\,]00//;
14 0 return $format;
15 }
16  
17 30 1;
« blib/lib/WWW/Shopify/Liquid/Operator.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Filter/Keys.pm »