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