Tuesday, February 1, 2011

digit to words NumberFormatterSpellOutStyle

NSNumberFormatter *frm = [[NSNumberFormatter alloc] init];
    [frm setNumberStyle:kCFNumberFormatterSpellOutStyle];
    //[frm setCurrencySymbol:@"$"];
    //[frm setMaximumFractionDigits:2];
    NSString *txttext=[[NSString alloc]initWithString:txt.text];
    //NSString *formatted = [frm stringFromNumber:[NSNumber numberWithInt:100000]];
    self.formatted = [frm stringFromNumber:[NSNumber numberWithInt:[txttext intValue]] ];
    self.finalstr=[NSString stringWithString:self.formatted];
    NSLog(@"formatted %@",self.finalstr);
    //[txt setText:self.finalstr];
    NSLog(@"@@@");

No comments:

Post a Comment