NSString *numberWord;
NSNumber *numberValue = [NSNumber numberWithInt:125];
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
numberWord = [numberFormatter stringFromNumber:numberValue];
//我要展示“صدوبیستوپنج”
最佳答案 您需要将数字格式化程序的语言环境设置为波斯语区域设置.
NSNumber *numberValue = @(125);
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
[numberFormatter setLocale:[NSLocale localeWithLocaleIdentifier:@"fa"]];
NSString *numberWord = [numberFormatter stringFromNumber:numberValue];
这将输出:
صد و بیست و پنج