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.
Author |
Topic |
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2012-09-11 : 04:36:37
|
I've got a number I am concatenating into a string in a procedure and when I do the insert in the procedure to the table it is displayed like:1.53502e+006 but should be 1535016 I want to retain the second number formatMy table data type for this field is FLOATWhat could I make it so that it doesn't do this?G |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-11 : 07:27:20
|
I assume you are using CAST or CONVERT to change the FLOAT to a string. Instead, use STR function. http://msdn.microsoft.com/en-us/library/ms189527.aspxFor example, run this and you will see the difference:declare @x float = 1535016;SELECT 'This is a number:' + CAST (@x AS VARCHAR(32)) SELECT 'This is a number:' + STR(@x,18,0) |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|