在C#中把双数四舍五入到两个小数位?
我想在c#中把双倍的数值四舍五入到小数点后两位,我该怎么做呢?
double inputValue = 48.485;
四舍五入后
inputValue = 48.49;
相关的: https://stackoverflow.com/questions/164926/c-sharp-how-do-i-round-a-decimal-value-to-2-decimal-places-for-output-on-a-pa
235
3
这很有效。
使用Math.Round。