Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在C#中使用小数位数进行舍入?_C#_.net - Fatal编程技术网

如何在C#中使用小数位数进行舍入?

如何在C#中使用小数位数进行舍入?,c#,.net,C#,.net,如何将逗号后的两位数字取整 Ex: I have a 3,7512 . I need 3,76 . 使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数 Math.Round(3.7512, 2) // this rounds up to 3.75 Math.Round(3.7572, 2) // this rounds up to 3.76 使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数 Math.Round(3.7512, 2) // this rounds up

如何将逗号后的两位数字取整

Ex: I have a 3,7512 . I need 3,76 .
使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数

Math.Round(3.7512, 2) // this rounds up to 3.75
Math.Round(3.7572, 2) // this rounds up to 3.76
使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数

Math.Round(3.7512, 2) // this rounds up to 3.75
Math.Round(3.7572, 2) // this rounds up to 3.76
使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数

Math.Round(3.7512, 2) // this rounds up to 3.75
Math.Round(3.7572, 2) // this rounds up to 3.76
使用该方法。它接受第二个参数,该参数确定要舍入多少个小数位数

Math.Round(3.7512, 2) // this rounds up to 3.75
Math.Round(3.7572, 2) // this rounds up to 3.76

那对你有用吗

double value = 0.01 * Math.Ceiling(100.0 * originalValue)

那对你有用吗

double value = 0.01 * Math.Ceiling(100.0 * originalValue)

那对你有用吗

double value = 0.01 * Math.Ceiling(100.0 * originalValue)

那对你有用吗

double value = 0.01 * Math.Ceiling(100.0 * originalValue)


它四舍五入到3.75。而我需要3.76。我一直都要集中注意力。但是,逻辑是什么呢?37512比3,76更接近3,75。我不明白你的逻辑,逻辑很简单。这是我在大学里得到的一个实验项目:)它精确到3.75。而我需要3.76。我一直都要集中注意力。但是,逻辑是什么呢?37512比3,76更接近3,75。我不明白你的逻辑,逻辑很简单。这是我在大学里得到的一个实验项目:)它精确到3.75。而我需要3.76。我一直都要集中注意力。但是,逻辑是什么呢?37512比3,76更接近3,75。我不明白你的逻辑,逻辑很简单。这是我在大学里得到的一个实验项目:)它精确到3.75。而我需要3.76。我一直都要集中注意力。但是,逻辑是什么呢?37512比3,76更接近3,75。我不明白你的逻辑,逻辑很简单。这是我在大学里得到的实验室项目:)如果值是:
37501
3750
37459
,结果会是什么?根据示例中的隐含逻辑(总是在两位数字后四舍五入),它将是
3,76
3,75
,和
3,75
。如果值为:
37501
3750
37459
,则结果必须是什么?根据示例中的隐含逻辑(总是在两位数字后四舍五入),它将是
3,76
3,75
,和
3,75
。如果值为:
37501
3750
37459
,则结果必须是什么?根据示例中的隐含逻辑(总是在两位数字后四舍五入),它将是
3,76
3,75
,和
3,75
。如果值为:
37501
3750
37459
,则结果必须是什么?根据示例中的隐含逻辑(总是在两位数字后四舍五入),它将是
3,76
3,75
3,75