sql – how to get decimal for an inetger

 

 

multiple ways of doing this.

select distinct inputvalue,
, round(CAST( inputvalueAS DOUBLE PRECISION ) / 1000.0, 3) — doesn’t secure 3 decimals
, round(inputvalue/1000.0,3) —  by default 6 decimals
, cast(inputvalue/1000.0 as float)
, convert(numeric (15,3), inputvalue/1000.0)

Leave a comment