On Oct 24, Peter Rabbitson said:

I am trying to subclass Math::Currency to change the default bstr() and
move it to a different function, so my numbers are not formatted by
default (I am unable to just strip existing formatting in a certain
situation).
...
However any arithmetics fails with an "Unknown round mode ''" error.

Crap, it was all written in the POD of Math::BigInt under Subclassing.
Adding the following globals to the class package solved the problem:

our $accuracy = undef;
our $precision = -2;
our $round_mode = 'even';
our $div_scale = 40;

That's poor planning, in my opinion. Those should be set up as methods of the object. :(

The idiom:

  package Class::Subclass;
  use base 'Class';
  1;

should be universal, no?

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to