简体   繁体   English

如何将小数点前的数字四舍五入?

[英]How to round up the number before decimal?

Can anyone suggest the way to implement this谁能建议实现这个的方法

Declare @x decimal(22,10)='234323154322.6787654321'
Declare @y decimal(20,10)=@x;

Currently giving error:目前报错:

Arithmetic overflow error converting numeric to data type numeric.将数字转换为数字数据类型时出现算术溢出错误。

Are you looking for this:你在找这个吗:

Declare @x decimal(22,10)='234323154322.6787654321'
Declare @y decimal(20,10)=@x/100;

SELECT @x,@y

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM