Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
The below script is returning different rounding results. However I am expecting the result to be 0.7767 in place of IncorrectRoundResult column. How can this be fixed without using CEIL?
RoundData:
LOAD
round(Num1/Num2,0.0001) as IncorrectRoundResult,
Num1/Num2 as NoRoundResult,
round(0.77665,0.0001) as CorrectRoundResult;
LOAD* INLINE
[
Num1, Num2
978579,1260000
]
;
How about this?
A bit kludgy, but it works.
round(round(Num1/Num2, 0.00001),0.0001) as CorrectRoundResult,
Look at this thread
This should return =Round(978579/1260000,0.0001)
Use ceil instead of round
Regards
I need to use the column names but not the actual values. When the actual values are used, it provides correct intended result
Ceil has issues like it would return 0.7666 for ceil(0.76653,0.0001)
Sunny already provide nice article. You can look diff of Floor and Ceil..
From Sunny provided link, i used ceil to get into work
How about this?
A bit kludgy, but it works.
round(round(Num1/Num2, 0.00001),0.0001) as CorrectRoundResult,
Thank you Marcus. It worked.