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 2005 Forums
 Transact-SQL (2005)
 Do not want to display a decimal point

Author  Topic 

MikeM
Starting Member

6 Posts

Posted - 2007-09-12 : 11:58:13
I have ran into something that I never needed before and have not been able to find a answer yet. Is there syntax that will allow me to remove a decimal point and show leading zeros? Example: I want 200.50 to be 00025050

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-12 : 12:06:47
Multiply by hundred?

SELECT CAST(Col1 * 100 AS BIGINT)
FROM Table1




E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-12 : 12:07:29
SELECT REPLACE(STR(100 * Col1, 8, 0), ' ', '0')
FROM Table1

E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-09-12 : 12:10:14
Didn't we do this already?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89225



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-12 : 12:14:25
Same class?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

MikeM
Starting Member

6 Posts

Posted - 2007-09-12 : 12:15:47
Thank you!
Go to Top of Page
   

- Advertisement -