Re: Name for converter of units/currency

From: Date: Fri, 19 Jan 2001 01:36:04 +0000
Subject: Re: Name for converter of units/currency
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1022@lists.php.net to get a copy of this message
Has anyone considered, in this discussion, the fundamental difference between converting units of *measurement* (which have fixed conversion ratios) and units of *currency* (for which the conversion ratios are variable). How are you intending to find the conversion ratio? If it's to be passed into the function by the caller, then I would suggest that the class is unnecessary. $dollars = $sterling / $conversion_ratio is not something that needs to be encapsulated. If it is to be located from some outside service, we need to talk about the reliability and general case for this. If it's to be stored in a database, there are a plethora of implementation issues. My vote would be to remove currency conversion entirely from PEAR. David On Sun, 7 Jan 2001, Chuck Hagenbuch wrote: > Quoting jmh3@linuxfreak.com: > > > have you ever purchased something in quantity? things are sold on a per > > volume, length, mass, power, etc. basis all of the time. i think an > > international commerce site would benifit from being able convert /both/ > > at the same time. > > Try to think generally. Are international commerce sites going to be the > _general_ case for using this class? Unless I am mistaken and somehow they are, > it makes sense to split it up and to let people who need both - like > international commerce sites - include both classes, instead of forcing both on > everyone. > > -chuck > > -- > Charles Hagenbuch, <chuck@horde.org> > "If you can't stand the heat, get out of the chicken!" - Baby Blues > >

« previous php.pear (#1022) next »