2011-12-19 26 views
2

在我的iPhone應用程序中,我使用了一個計費系統。默認情況下,總帳單金額爲$(美國)符號。但我想根據國家動態更改貨幣符號。這意味着,如果應用用戶在歐洲,我需要將貨幣符號更改爲。我如何管理本地化並根據我的應用中的國家更改貨幣符號?誰能幫幫我嗎?如何在iPhone應用程序中動態更改貨幣類型?

+0

的可能重複[本地化貨幣的iPhone(http://stackoverflow.com/questions/856019/localize-currency-for-iphone) – kennytm 2011-12-19 04:21:02

+0

我用這個代碼從你的鏈接, NSDecimalNumber *量= [NSDecimalNumber decimalNumberWithString :@ 「10.00」]; NSNumberFormatter * currencyFormat = [[NSNumberFormatter alloc] init]; NSLocale * locale = [NSLocale currentLocale]; [currencyFormat setNumberStyle:NSNumberFormatterCurrencyStyle]; [currencyFormat setLocale:locale]; NSLog(@「符號數量:%@」,[currencyFormat stringFromNumber:amount]);但是,它總是以'$'符號返回。我已經在我的iPhone中將時區更改爲'London,england',仍然以'$ 10.00'這種格式返回代碼。如果我錯了,請幫助我。 – 2011-12-19 05:00:28

回答

相關問題