1 package SL::DB::Helpers::AttrNumber;
10 my $attribute = shift;
13 $params{places} = 2 if !defined($params{places});
18 sub ${attribute}_as_number {
22 \$self->${attribute}(\$::form->parse_amount(\\\%::myconfig, \$_[0]));
25 return \$::form->format_amount(\\\%::myconfig, \$self->${attribute}, $params{places});
32 croak "Defining '${attribute}_as_number' failed: $EVAL_ERROR" if $EVAL_ERROR;