'Avoid exponent in float data
Currently, abc is a float data type. I want to avoid exponent in float data. I have used the following to keep the data without an exponent, but it converts the data type as a string. I want to keep it as a float.
Can you please assist?
SELECT FORMAT('%.2f', abc) AS deduction FROM table
Solution 1:[1]
You could apply a casting operation to your FORMAT, so that the end result is casted to float:
SELECT CAST(FORMAT('%.2f', abc) AS float64) AS deduction FROM table
For more information on casting rules, you can visit the documentation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Atalajaka |
