0

I'm using a mail job and proc to send mails to the users. It turned out that I didn't make the control for the scientific notations and they complained about it. Now, I changed the code but I can't test it. It's not all the numbers which are transformed into scientific form, so I'm looking for a way to make me know that my code is working ok.

What I need to know is, when is scientific notation used? Which numbers are transformed to scientific notation?

Zafer Sernikli
  • 163
  • 3
  • 18
  • What type are your numeric fields, and are you using to render them to strings? – Bohemian Jan 08 '14 at 08:22
  • They're float. I first ROUND them, then CONVERT to varchar. I added CAST AS REAL to the code, after ROUNDing. It's now something like CONVERT(VARCHAR,(CAST(ROUND x,2) AS REAL). – Zafer Sernikli Jan 08 '14 at 08:26

2 Answers2

0

When you need to convert real values or float values to varchar or nvarchar sql would convert scientific notation when the digits are more than seven

Sajad Karuthedath
  • 14,987
  • 4
  • 32
  • 49
0

When you convert real/float values to varchar/nvarchar, it will convert as the regualr decimal number when the digits are less than 7 otherwise it will use the scientific notation.

Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115