Round down by a specific precision in C#

后端 未结 1 1351
轮回少年
轮回少年 2021-01-22 20:46

How can I round down a double by a specific precision. I need a function that gets a double and returns the closest value to that double t

1条回答
  •  遇见更好的自我
    2021-01-22 21:03

    Math.Floor(value / precision) * precision
    

    0 讨论(0)
提交回复
热议问题