1. 使用 Round() 函数,如 Round(@num,2)  参数 2 表示 保留两位有效数字。

2. 更好的方法是使用 Convert(decimal(18,2),@num) 实现转换,decimal(18,2) 指定要保留的有效数字。

最好使用第二种,比如:convert(decimal(18,1),单价) 其中1表示保存1位小数,如果是0则表示整数

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-02-07
  • 2021-11-24
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-09-14
相关资源
相似解决方案