看看net的四舍五入:

  static void Main(string[] args)
        {
            Console.WriteLine(Math.Round(1.015, 2));
            Console.WriteLine(Math.Round(1.0151, 2));
            Console.WriteLine(Math.Round(1.0149, 2));
  
            Console.ReadLine();
        }

Output:

1.01
1.02
1.01
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-12-31
  • 2021-08-14
  • 2022-12-23
相关资源
相似解决方案