blib/lib/DTL/Fast/Filter/Numberformat.pm

filter: Statementstmt 100% 19 / 19 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 92.5% 25 / 27 SCAR 6.9
CC
2
Cov
95%
filter
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/DTL/Fast/Filter/Cut.pm ↑ Summary blib/lib/DTL/Fast/Filter/Linebreaks.pm »
1 package DTL::Fast::Filter::Numberformat;
2 2 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use parent 'DTL::Fast::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::FILTER_HANDLERS{'numberformat'} = __PACKAGE__;
6  
7 #@Override
8 sub filter
9 {
10 16 ▶ my( $self, $filter_manager, $value, $context) = @_;
Subroutine filter: called CC=2 SCAR=7.0
Pod undocumented
11  
12 16 ▶ die $self->get_render_error($context, 'unable to numberformat undef value')
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 16 16
13 if not defined $value;
14
15 16 my @num = split /\./, $value;
16 16 $num[0] =~ s/
17 (\d)(?=
18 (\d{3})+(?!\d)
19 )
20 /$1 /gsx;
21
22 16 return join '.', @num;
23 }
24  
25 2 1;
« blib/lib/DTL/Fast/Filter/Cut.pm ↑ Summary blib/lib/DTL/Fast/Filter/Linebreaks.pm »