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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 FORMAT DECIMAL POINTS 4 digits to the right FORMAT

Author  Topic 

jennypretty
Yak Posting Veteran

96 Posts

Posted - 2004-11-02 : 11:16:28
HELLO friends,
I was trying to convert a number with 4 digits to the right, but it shows errors.
This is my Emp table
Emp_Percent
-----------
0.281800002
0.8729022
0.47820000000278

HOW TO CONVERT THIS TO 4 digits to the right? like:
0.2818
0.8729
0.4782

Big thanks.

Jenny.

The stupid question is the question you don't ask.
www.single123.com

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-11-02 : 11:23:08
Select convert(money,Emp_Percent) From Emp

Corey
Go to Top of Page

jennypretty
Yak Posting Veteran

96 Posts

Posted - 2004-11-02 : 12:12:19
Woh, it worked. How about this?
Emp_Percent
-----------
1
0.8729022
0.47000000001

HOW TO CONVERT THIS TO 4 digits to the right? if a number have 00000 at the end, it must stop at the ist zero, and, if number 1 only, then it should not add any zero at the end.
1
0.8729
0.47

Please help.
Jen.

The stupid question is the question you don't ask.
www.single123.com
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-11-02 : 12:21:33
see the str function.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -