ios - NSLocalizedString for number -


i want translate 1 or 1 chinese or other languages. number can start 0 infinity. how shall translate/show (with nslocalizedstring or other) ?

as trojanfoe suggest stick numbers seems opinion.

if want translate numbers, can done follows :-

nsdecimalnumber *yournumber = [nsdecimalnumber decimalnumberwithstring:@"456"]; nsnumberformatter *formatter = [[nsnumberformatter alloc] init]; nslocale *yourlocale = [[nslocale alloc] initwithlocaleidentifier:@"zh"]; [formatter setlocale: yourlocale]; nslog(@"%@", [formatter stringfromnumber: yournumber]); // logs value in chinese [formatter setlocale:[nslocale currentlocale]]; nslog(@"%@", [formatter stringfromnumber: yournumber]); // logs value in current locale 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -