Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Round Function (Zero Elimination)

Author  Topic 

Weekend
Starting Member

20 Posts

Posted - 2007-07-19 : 02:01:37
Hi

I use round function

select round(1234.4545,2)
GO

Result
1234.4500

I want last two zero to be eliminate.
Please advise how?

Thanks
Jawad

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-19 : 03:28:35
[code]SELECT CONVERT(decimal(10,2), ROUND(1234.4545, 2))[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-19 : 04:18:00
If you want to show them in front end, you can use format function

Format (Rs("col"),"######.00")

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Weekend
Starting Member

20 Posts

Posted - 2007-07-19 : 05:29:38
Dear Khtan / Madhivanan

Thanks to both of you.
Plus Khtan solution work best for me.

Thanks
Jawad
Go to Top of Page
   

- Advertisement -