prePEP: Money data type

John Roth newsgroups at jhrothjr.com
Sat Oct 18 16:53:10 EDT 2003


"Dennis Lee Bieber" <wlfraed at ix.netcom.com> wrote in message
news:l5i861-pe3.ln1 at beastie.ix.netcom.com...
> <posted & mailed>
>
> Alex Martelli fed this fish to the penguins on Saturday 18 October 2003
> 11:11 am:
>
>
> >
> > They have (at least since the early '60s -- not sure when Cobol
> > was first released) but the accountants have not necessarily been
> > happy with their treatment of cents.
> >
>         My memory is failing, but I think FORTRAN predates COBOL by a few
> years... I think CODASYL got the first COBOL spec out around 1961. The
> language was standardized around 68 (74, 85, 2000?)
>
> >
> > Until and unless somebody bangs EU and US legislators' heads
> > together, and forces them to agree on one common standard for
> > accounting (down to such details as how to round half cents),
> > I don't see what programmers, as such, can do about it -- except
> > keep their software customizable in such variant-by-jurisdiction
> > respects:-(.
> >
>         I'd suspect the safest method would be to keep the data internally
one
> or two decimal places beyond that needed for the most precise currency
> expected, and perform locale specific rounding only when reporting
> values. (Something I suspect the Lockheed payroll system has to do, as
> my current annual rate is 100,866.000000 [yes, the paycheck stub lists
> 6 decimal places!], which works out to an hourly rate of 48.493269xxx
> -- if they'd rounded the latter before calculating the paycheck I'd be
> cheated out of nearly $7 a year. Does make it painful to track in
> Quicken -- every week a different gross pay or tax deduction appears as
> the "error" for each item reaches the rounding "roll-over" point)

Sometimes that's also a result of union negotions and interesting
policies to avoid losing cents to rounding errors. One way of handling
all of this is to always calcualte YTD and then subtract the prior YTD
to get current. Then there are interesting strategies to allocate the cents
to the workers on alternate weeks so that nobody files a union grievance...

John Roth

>
> -- 
>  > ============================================================== <
>  >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >      wulfraed at dm.net     |       Bestiaria Support Staff       <
>  > ============================================================== <
>  >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>  >            Home Page: http://www.dm.net/~wulfraed/             <
>






More information about the Python-list mailing list