Re: Money casting too liberal?

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Money casting too liberal?
Date: 2013-04-02 19:17:24
Message-ID: 515B2EC4.3090209@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/04/13 07:16, John R Pierce wrote:
> On 4/2/2013 12:50 AM, Gavin Flower wrote:
>> In the bad old days when I was a COBOL programmer we always stored
>> money in the COBOL equivalent of an integer (numeric without a
>> fractional part) to avoid round off, but we displayed with a decimal
>> point to digits to the left. So storing as an integer (actually
>> bigint would be required) is a good idea, with parameters to say how
>> many effective digits in the fractional part, and how many fractional
>> digits to display etc. - as you said.
>
> COBOL Numeric was BCD. same as NUMERIC in SQL (yes, I know
> postgresql internally uses a base 10000 notation for this, storing it
> as an array of short ints, but effectively its equivalent to BCD).
>
>
>
>
>
> --
> john r pierce 37N 122W
> somewhere on the middle of the left coast
It was many years ago! :-)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2013-04-02 19:37:10 Re: Using varchar primary keys.
Previous Message Samantha Atkins 2013-04-02 19:01:32 Re: Using varchar primary keys.