2012-10-09 38 views
0

可能重複:
Localize Currency for iPhone目標C各自國家利用貨幣格式

我一直使用貨幣開發的Mac應用程序,在此應用程序的IM。這裏不能做印度盧比。 我想要這個應用程序在全球範圍內使用。所以我需要開發這樣的用戶獲得他的各自的國家貨幣。 如果我選擇任何國家電郵國家貨幣shud被使用 我不知道如何做到這一點。你能否幫助我,如果你知道。

在此先感謝。

+0

見http://stackoverflow.com/questions/4427680/iphone-how-to-get-local-currency-symbol-i-e-unstead-of-au – CAMOBAP

回答

2

您可以使用此代碼:

NSNumberFormatter* fmtr = [[[NSNumberFormatter alloc] init] autorelease]; 
[fmtr setNumberStyle:NSNumberFormatterCurrencyStyle]; 
[fmtr setLocale:[NSLocale currentLocale]]; 

NSLog(@"%@", [fmtr currencySymbol]); // Prints '$' for example 
NSLog(@"%@", [fmtr internationalCurrencySymbol]); // Prints 'USD' for example