« blib/lib/WWW/Shopify/Liquid/Filter/Keys.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Filter/ImgTag.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 | 30 | ▶ | package WWW::Shopify::Liquid::Filter::Money; use base 'WWW::Shopify::Liquid::Filter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | sub operate { | ||||||||||
| 7 | 0 | ▶ | return undef unless $_[2]; | ||||||||
|
Subroutine
operate: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 1 branch
| |||||||||||
| 8 | 0 | my $format = $_[1]->{shop}->{money_format}; | |||||||||
| 9 | 0 | ▶ | $format = '$ {{ amount }}' unless $format; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | 0 | my $amount = sprintf('%.2f', $_[2] / 100.0); | |||||||||
| 11 | 0 | $format =~ s/\{\{\s*amount\s*\}\}/$amount/; | |||||||||
| 12 | 0 | return $format; | |||||||||
| 13 | } | ||||||||||
| 14 | 30 | 1; | |||||||||