[thelist] ASP/SQL Solution for Double Currency Web Site

JR jr_junk at yahoo.com
Wed Feb 21 19:14:43 CST 2001


-------------------------------------------------
Or, should I just drop this rate (essentially, the
three lines of code
presented above), into an include file, then call the
include file as 
needed
in the various ASP processing pages?  Seems simple
enough to me??
-------------------------------------------------

That's what I would do...you don't want any MAGIC
numbers in your code.




--- Michele Foster <michele at wordpro.on.ca> wrote:
> Hi Folks ...
> 
> I would like to know how others handle currency
> differences on their web
> sites.  This could also apply to differing tax
> rates.  But, for my example,
> I'm wondering what the best approach it to
> displaying both Canadian and U.S.
> prices on my web site.
> 
> At the moment, on the ASP pages that pull the data
> out of my database, I
> have added the following code, which takes my CDN
> price and figures out the
> approximate equivalent in US dollars, then I can
> easily display both values
> on my web site.  Obviously, my database ONLY
> contains the Canadian dollars.
> 
> varCDNPrice = rst("Price")
> varExRate = 0.7
> varUSPrice = (varCDNPrice * varExRate)
> 
> Is the above reasonable?  Or am I better off having
> BOTH prices in my
> database?  I don't see how this could be valuable. 
> As you'll see with my
> next question.
> 
> I'm wondering if I should actually be storing my
> "varExRate" in my database?
> The reason being, the Exchange Rate is used on
> several different ASP pages.
> Plus, we all know exchange rates fluctuate, and
> there will be a time when
> this rate will be changed.  Generally speaking,
> minor market fluctuations,
> I'm not too concerned about.  My concern is that
> with "hard-coding" the
> exchange rate into the ASP pages, when I need to
> update this rate, I'll have
> to be sure to catch all the instances where it is
> used (memory being what it
> is, I'll forget at least one instance).   [Same
> applies to tax rates
> changing.]
> 
> So, what can I do?  What do others do?  If I put it
> in the DB, as its own
> table, one record, this will require me to make a
> second call to the DB to
> get this value out.. I think.  I don't believe I can
> use an "AND" within a
> SELECT statement in SQL, but I could be mistaken on
> this.  (Current select
> statement is:  "SELECT Pic, ItemNo, Description,
> MoldMfg, MoldNo, Price,
> Size FROM ceramics ".)
> 
> Or, should I just drop this rate (essentially, the
> three lines of code
> presented above), into an include file, then call
> the include file as needed
> in the various ASP processing pages?  Seems simple
> enough to me??
> 
> Thanks in advance for guidance ....
> 
> Michele
> 
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/




More information about the thelist mailing list