0
votes

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?

2
What type are your numeric fields, and are you using to render them to strings? - Bohemian
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

2 Answers

0
votes

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

0
votes

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.