X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/82515b2d93dc5632f24d6e0b6f8f05f3fd19fbb0..cbbcefbbb1b2b58752bd9dd9d374c6092323ef27:/SL/DB/Helpers/AttrNumber.pm diff --git a/SL/DB/Helpers/AttrNumber.pm b/SL/DB/Helpers/AttrNumber.pm index 98acf192c..6593fb708 100644 --- a/SL/DB/Helpers/AttrNumber.pm +++ b/SL/DB/Helpers/AttrNumber.pm @@ -12,24 +12,14 @@ sub define { $params{places} = 2 if !defined($params{places}); - my $code = <$attribute($::form->parse_amount(\%::myconfig, $string)) if @_ > 1; - if (scalar \@_) { - \$self->${attribute}(\$::form->parse_amount(\\\%::myconfig, \$_[0])); - } - - return \$::form->format_amount(\\\%::myconfig, \$self->${attribute}, $params{places}); -} - -1; -CODE - - eval $code; - croak "Defining '${attribute}_as_number' failed: $EVAL_ERROR" if $EVAL_ERROR; + return $::form->format_amount(\%::myconfig, $self->$attribute, $params{places}); + }; return 1; }