1 package SL::DB::Helpers::AttrNumber;
10 my $attribute = shift;
13 $params{places} = 2 if !defined($params{places});
16 *{ $package . '::' . $attribute . '_as_number' } = sub {
17 my ($self, $string) = @_;
19 $self->$attribute($::form->parse_amount(\%::myconfig, $string)) if @_ > 1;
21 return $::form->format_amount(\%::myconfig, $self->$attribute, $params{places});