Boost logo

Boost :

From: Kevin Lynch (krlynch_at_[hidden])
Date: 2001-10-04 14:57:10

Bill Seymour wrote:
> - WEB wrote:
> >
> > Finally, I am disappointed that no one has stepped forward
> > to help address the oft-repeated request/need for a general-
> > purpose Currency library.
> >
> and Kevin Lynch replied:
> >
> > I think that this is because many of us see this as a trivial
> > extension of a (currently nonexistent) extensible, general
> > purpose unit framework, ...
> >
> I don't think it would be trivial at all.
> In connection with the fixed-point decimal library that I'm
> still working on, I did a little research trying to find out
> what accountants mean by rounding "up" (I think they mean
> away from zero); and I came across a European standard
> for converting between euros and EU national currencies.
> The requirement are very specific: multiply by the
> conversion factor (don't divide by its reciprocal),
> figure the answer to six decimal places, then round up.
> --Bill Seymour

But this doesn't, to me, seem to argue against it being a "trivial"
(perhaps a poor choice of words) application of a general purpose
system. I did not mean to imply that the implementation of the
conversion itself would be trivial. Handling the fact that currencies
have units and that those units are interconvertible is "conceptually
trivial" in the context of a library that handles all the issues
associated with units. For example, converting between $/kilo and
Euro/kilo is conceptually no more complicated than converting m/s to
furlong/fortnight. That the implementation of the conversion functions
may be large and complicated, I do not doubt. I meant only to say that
currencies do fit, without needing special case handling, into a larger
framework of quantities and units. They can not be treated as a special
case that gets its own library; otherwise, you lose the ability to use
that currency library in many many contexts (think grocery store
checkout systems, futures contracts, billing systems for electricity
usage, etc. etc. etc.) where you need to track OTHER quantities.

Kevin Lynch				voice:	 (617) 353-6065
Physics Department			Fax: (617) 353-6062
Boston University			office:	 PRB-565
590 Commonwealth Ave.			e-mail:	 krlynch_at_[hidden]
Boston, MA 02215 USA

Boost list run by bdawes at, gregod at, cpdaniel at, john at