Schema

Dave Peticolas dave@krondo.com
Wed, 13 Dec 2000 23:37:00 -0800


David Merrill writes:
> On Wed, Dec 13, 2000 at 02:35:30PM -0800, Gordon Oliver wrote:
> > So the denominator goes: smallest divisible unit. (amount atoms?)
> > And the numerator: number of smallest divisible units
> 
> Got it now, thanks. The numerator value is in terms of the smallest
> unit of measure for the item. Pennies in the US, for example.
> 
> The denominator seems then to be a way of getting from that smallest
> unit of measure to the standard unit of measure. In the US, that means
> from pennies to dollars, therefore the denominator is 100.
> 
> So, a penny is 1/100, a dollar is 100/100. Is the rational number
> always maintained in that form or is would it be stored as 1/1?

Stored as 100 / 100.


> So is it true then that US currency is always stored in pennies/100?

Unless you are in a special situation. For example, like stocks,
it may be that you can invest in currencies using fractional amounts
if your brokerage allows it. I'm really not sure. But by default, and
in most situations, USD will be stored as pennies.



> And, what do these quantities represent when storing a stock?

Generally, the precision with which your brokerage allows you to
buy stock. This may not always be something you can find out.


> If there's a Fine Manual I should be reading, please point me to it
> and I'll quit using up your time.

There is an OK Unfinished Manual in src/doc/design, but I don't think
it has the sections on the new commodity stuff yet.

dave