iOS 取后两位并且四舍五入

            NSNumber *priceNum = [NSNumber numberWithFloat:123.125];

            NSLog(@"----%@---",[NSString stringWithFormat:@"%.2f",round([priceNum floatValue]*100)/100]);

    //123.13

posted @ 2016-02-26 18:24  应有梦  阅读(1851)  评论(0编辑  收藏  举报