①显示为百分比 ②只保留2位小数 ③显示小数点前的0 ④负值使用括号表示 ⑤不使用分组符号 即设想输出的内容为:87.54% 解决方法: <%=FormatPercent(0.87543,2,-1,-1,0)%> FormatPercent(A,B,C,D,E): A: 需要被格式化的表达式 B: 保留几位小数点 C:可选,是否显示小数前的0,例如0.123。 -2:不填时默...
// 百分比格式 NSString *percentStr = [NSNumberFormatterlocalizedStringFromNumber:f numberStyle:NSNumberFormatterPercentStyle];// 货币格式(货币符号与当前系统设置的区域和语言位置有关)NSString *currencyStr = [NSNumberFormatterlocalizedStringFromNumber:f numberStyle:NSNumberFormatterCurrencyStyle];...