Remove decimal with out rounding.
-
Hi, I am using sql 2005.I have a value -0.026880000000000 but I want the result as -0.0268 just 3 decimals.If I use select convert(decimal(18,3),-0.026880000000000) I am getting -0.027 with rounded. can anybody help me out in this. Thx
Try this: a) Multiply the value by 1,000 b) Truncate the value c) Divide the number by 1,000 David
-
Try this: a) Multiply the value by 1,000 b) Truncate the value c) Divide the number by 1,000 David
-
Hi, I am using sql 2005.I have a value -0.026880000000000 but I want the result as -0.0268 just 3 decimals.If I use select convert(decimal(18,3),-0.026880000000000) I am getting -0.027 with rounded. can anybody help me out in this. Thx
select convert(int,convert(decimal(18,5),-0.026880000000000)*100000.0)/100000.0
-
Try this: a) Multiply the value by 1,000 b) Truncate the value c) Divide the number by 1,000 David
I realize someone already replied, but here is my 2 cents ...
select convert(decimal(18,3),(convert(integer,(-0.0268000000000000000)*1000)))/1000
-
Hi, I am using sql 2005.I have a value -0.026880000000000 but I want the result as -0.0268 just 3 decimals.If I use select convert(decimal(18,3),-0.026880000000000) I am getting -0.027 with rounded. can anybody help me out in this. Thx
-
Hi, I am using sql 2005.I have a value -0.026880000000000 but I want the result as -0.0268 just 3 decimals.If I use select convert(decimal(18,3),-0.026880000000000) I am getting -0.027 with rounded. can anybody help me out in this. Thx
Use
floor
.