【问题标题】:How to round up a number to the tens unit in c#? [duplicate]如何在c#中将一个数字四舍五入到十位? [复制]
【发布时间】:2024-01-01 00:42:01
【问题描述】:

如何以最简单的方式向上或向下舍入数字? 例如

36 >>> 40

33 >>> 30

【问题讨论】:

标签: c# numbers rounding


【解决方案1】:

查看System.Math.Round 的文档。您可以指定是否要向上/向下舍入以及要舍入到的间隔。

【讨论】:

最近更新 更多