line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Numberformat; |
2
|
2
|
|
|
2
|
|
787
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
48
|
|
3
|
2
|
|
|
2
|
|
8
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
4
|
2
|
|
|
2
|
|
39
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
5
|
2
|
|
|
2
|
|
9
|
use parent 'DTL::Fast::Filter'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{numberformat} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#@Override |
10
|
|
|
|
|
|
|
sub filter |
11
|
|
|
|
|
|
|
{ |
12
|
16
|
|
|
16
|
0
|
34
|
my ( $self, $filter_manager, $value, $context) = @_; |
13
|
|
|
|
|
|
|
|
14
|
16
|
50
|
|
|
|
38
|
die $self->get_render_error($context, 'unable to numberformat undef value') |
15
|
|
|
|
|
|
|
if (not defined $value); |
16
|
|
|
|
|
|
|
|
17
|
16
|
|
|
|
|
46
|
my @num = split /\./, $value; |
18
|
16
|
|
|
|
|
122
|
$num[0] =~ s/ |
19
|
|
|
|
|
|
|
(\d)(?= |
20
|
|
|
|
|
|
|
(\d{3})+(?!\d) |
21
|
|
|
|
|
|
|
) |
22
|
|
|
|
|
|
|
/$1 /gsx; |
23
|
|
|
|
|
|
|
|
24
|
16
|
|
|
|
|
71
|
return join '.', @num; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |