line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::Money; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::Money::VERSION = '1.162360'; |
3
|
1
|
|
|
1
|
|
850
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
2
|
use base 'Form::Processor::Field::Text'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
412
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
0
|
5
|
sub init_value_format {'%.2f'} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub validate { |
12
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
2
|
50
|
|
|
|
6
|
return unless $self->SUPER::validate; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# remove plus sign. |
17
|
2
|
|
|
|
|
3
|
my $value = $self->input; |
18
|
|
|
|
|
|
|
|
19
|
2
|
50
|
|
|
|
2
|
return unless defined $value; |
20
|
|
|
|
|
|
|
|
21
|
2
|
50
|
|
|
|
7
|
if ( $value =~ s/^\$// ) { |
22
|
2
|
|
|
|
|
3
|
$self->input( $value ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
2
|
100
|
|
|
|
11
|
return $self->add_error( 'Value must be a real number' ) |
26
|
|
|
|
|
|
|
unless $value =~ /^-?\d+\.?\d*$/; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
3
|
return 1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ABSTRACT: Input US currenty-like values. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |