dotnetdevcsharp
dotnetdevcsharp

Reputation: 3980

Currency selection and price conversion in ASP.Net

I am creating an e-commerce site in ASP.Net 4.0 with C# and I was wondering what is the best way to deal with currency selection? I need to offer GB Pound, Euro and soon other currencies. What is the best way to convert prices displayed on a page on the fly?

I know that I have to have something like a base-rate table, can someone provide an example of this?

Upvotes: 0

Views: 1406

Answers (2)

Sleiman Jneidi
Sleiman Jneidi

Reputation: 23339

There is web service called xignite

It converts From any currency to any currency .It is always up to date and reliable with every application.But it is not free and you pay for every hit or conversion.

Upvotes: 3

Simon
Simon

Reputation: 6152

A couple of points to consider:

  1. How often do you need to update the currency rates? Hourly, daily, real-time? This will affect your design. I would suggest that daily would be a good place to start.
  2. I would pick a 'base' currency - probably GBP in your case - and FX all other currencies to this. For example a simple table (refreshed as per point 1) would contain the target currency (say EUR), the FX rate (to your base currency, today something like 1.201) and the date.
  3. Build something that automatically connects to one of the free RSS feeds out there to populate your table (plenty of stuff out there if you do a simple Google search). Alternatively, if rates are updated infrequently then this could be a manual population.
  4. Avoid hard-coding anything into the pages themselves, always FX on the fly as required. Note that this will mean keeping an archive of rates in the table.

Upvotes: 1

Related Questions