LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2003, 09:03 AM   #1
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Rep: Reputation: 30
Question [PHP] Currency Conversion


Hi,

I need a system to automatically retrieve exchange rates that I can then use on my site to convert a value held in a database to that currency. Does any one have some code or source of code that I can use for this.

I tried systems that use SOAP but i kept getting errors and I dont have a clue what was going on!

I just want to create function that will grab the rates for USD, GBP and Euros and then convert using a single function, something like:

PHP Code:
function curConvert($amount$from$to) {

  if (!
strcmp($from,"USD") {
    
// Check $to
     //Convert from USD to $to and return ammount
   
}

  if (!
strcmp($from,"GBP") {
     
// Check $to
     //Convert from GBP to $to and return ammount
  
}

  if (!
strcmp($from,"EUR") {
     
// Check $to
     //Convert from EUR to $to and return ammount
  
}


TIA

Last edited by pnh73; 11-15-2003 at 09:04 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kspread currency problems blastradius Linux - Software 0 08-05-2005 01:29 AM
Formatting currency in Perl lowpro2k3 Programming 2 04-14-2005 02:12 PM
Question on UK Currency/denominations Texicle General 26 11-01-2003 11:17 AM
ASP to PHP Conversion Goblin Programming 11 08-26-2003 12:43 PM
Gnumeric And Currency Symbols? petercool Linux - Software 0 07-15-2003 08:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration