line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
46
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
package WWW::Shopify::Liquid::Dialect::Shopify::Filter::Money; use base 'WWW::Shopify::Liquid::Filter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
297
|
|
6
|
|
|
|
|
|
|
sub operate { |
7
|
0
|
0
|
|
0
|
0
|
|
return undef unless $_[2]; |
8
|
0
|
|
|
|
|
|
my $format = $_[1]->{shop}->{money_format}; |
9
|
0
|
0
|
|
|
|
|
$format = '$ {{ amount }}' unless $format; |
10
|
0
|
|
|
|
|
|
my $amount = sprintf('%.2f', $_[2] / 100.0); |
11
|
0
|
|
|
|
|
|
$format =~ s/\{\{\s*amount\s*\}\}/$amount/; |
12
|
0
|
|
|
|
|
|
return $format; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
1; |