| 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
| |||||||||||
| 9 | 0 | my $format = $_[1]->{shop}->{money_format}; | |||||||||
| 10 | 0 | ▶ | $format = '$ {{ amount }' unless $format; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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; | |||||||||