Converting Number to String With Decimal Points

Hi experts
     I'm need convert number data type to string but i need convert with decimal points.
Example when i convert '100.000,00' (number) field to string it seems like '10000000'(str) but i need '100.000,00'(str)
LVL 1
nwncysAsked:
Who is Participating?
 
DimitrisConnect With a Mentor Senior Solution ArchitectCommented:
here u r

You have to convert your decimal field to money and after that to string
see this sample
declare @MyValue as decimal(18,2)
SET @MyValue = 100000.00
 
SELECT CONVERT(nvarchar,cast(@MyValue as money),1)

Open in new window

0
 
venkatcaCommented:
Is this what you are looking for?
declare @value decimal(12,2)
set @value=100000
select cast(@value as varchar(12))

Open in new window

0
 
venkatcaCommented:
If you need further formatting with commas, etc, there is an article in this site which discusses the same.

http://www.codeproject.com/KB/database/SQLPhoneNumbersPart_2.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.