How can I format a percent using 2 digits after the decimal
조회 수: 97(최근 30일)
Geoff 2012년 3월 13일
If you want to do it without using strings:
round(x * 100) / 100;
One reason you might want to do that is if you have a whole matrix of percentages and want to quickly show them in a sensible way, without messing with the output format for other numbers.