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
Any help would be great?
thanks Don
Rounding a decimal number to two decimal places is the same as rounding it to the hundredths place, which is the second place to the right of the decimal point. For example, 2.83620364 can be round to two decimal places as 2.84, and 0.7035 can be round to two decimal places as 0.70.
Ceiling(Decimal) Returns the smallest integral value that is greater than or equal to the specified decimal number.
Using ROUND() function with a variable and getting the rounded number to -2 decimal place.
you can try this.
select ceiling(141.63 * 10) / 10.0 ,
ceiling(140.08 * 10) / 10.0
Result
141.700000
140.100000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With