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