Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Converting Number to String With Decimal Points

Posted on 2009-05-20
Medium Priority
1,420 Views
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)
0
Question by:nwncys
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 1

Expert Comment

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

LVL 1

Expert Comment

ID: 24429628
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

LVL 12

Accepted Solution

Dimitris earned 1000 total points
ID: 24429727
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)
``````
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
###### Suggested Courses
Course of the Month11 days, 3 hours left to enroll