[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed framework changes for 1.4

On Tue, Oct 18, 2011 at 9:26 AM, John Locke <..hidden..> wrote:
> Hi,
> Sounds like a good direction to me. Couple thoughts -- not being that
> active in Perl, don't know if these are realistic or not, but just what
> comes to mind, feel free to disregard.
> - Are there really no other date or number libraries available that do
> what we need, to the point we need to create our own? (or are these
> primarily wrappers around something else?)

Just following up on this a little more.

My current plan for PGNumeric is to try to write a wrapper that uses
Math::BigFloat for storage and locale for formatting.

The idea is that each class basically includes 4 methods:

$object = Class->from_input($string); # human entered
$string = $object->to_output(); # Localized
$object = Class->from_dbstring($string); #Standard db format
$string = $object->to_dbstring(); # Standard db format

The underlying storage object would be available via an accessor for
calculation purposes.

Best Wishes,
Chris Travers