摘要: double RV5SV1AmpTmV =[ self roundFloat:CGFloatSV1+CGFloatRV5 ]; // 四舍五入保留三位小数 #pragma mark - 四舍五入保留三位小数 -(float)roundFloat:(float)price{ NSString *tem 阅读全文
posted @ 2018-06-14 15:11 懒猫口米 阅读(837) 评论(0) 推荐(0) 编辑
摘要: CGFloat f = 123.1234567890; NSString *str=[NSString stringWithFormat:@”%.2f”, f]; 如上所述:字符串格式化,格式出输入%.2f ,及表示两位小数 如果取后3位即 %.3f 后4位即 %.4f 阅读全文
posted @ 2018-06-14 15:03 懒猫口米 阅读(1012) 评论(0) 推荐(0) 编辑