sqlsql-serverroundingceil

round,ceiling 2 decimal points


I want to round up some figures that have 2 decimals points to 1. However, I always want it to round 1 examples of the list of figures in column amount

140.08 = 140.1
141.63 = 141.7

if I use round(141.63,1) it equals 142.6, but I want all the decimal points to round up, similar to the ceiling function. I want 141.7


Solution

  • you can try this.

    select ceiling(141.63 * 10) / 10.0 ,
           ceiling(140.08 * 10) / 10.0
    

    Result

    141.700000                              
    140.100000