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

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -