简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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