How do you do metric conversions?

iPhone: How do I lookup currency conversions?

  • I'm wanting to perform currency conversions in my iPhone app. Putting aside the issues of number formatting or currency symbols, how do I convert from X USD to Y CAD (or similar)? I know Google and Yahoo! have APIs which deal with this kind of thing, I just lack the knowledge to access it from my app. Any code or URLs to examples would be cool. Thanks, Dave.

  • Answer:

    http://betterexplained.com/articles/using-json-to-exchange-data/ does that help? scroll to the currency conversion stuff there where there's a datasource mentioned which returns XML. You may then use the NSXML parser to parse the results check this one as well, looks dead simple: http://www.exchangerate-api.com/

Dave Steadman at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Thanks for the links, I was able to get the result I need with the following line: label.text = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.exchangerate-api.com/USD/GBP/100?k=<<API KEY>>"] encoding:CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000) error:NULL];

Dave Steadman

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.