Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a question about Floor Function. Could someone explain how Floor(3.5,-0.5) results in 4.0? I was thinking that it would result in 3.0
Any help will be greatly appreciated
Into version 12 returns 3.5 that is consistent since you are passing a "step" parameter 0.5
If you want to floor to next integer use Floor(3.5)
Floor Rounds down to the nearest multiple of the second parameter (to the precision of the second parameter).
Floor(3.6) -- > 3
Floor(3.6, 0.5) -- > 3.5
Floor(3.6, 0.1) -- > 3.6
(In all versions of QV that I have used)
Hello Rahul,
You use a Floor function (= kind of rounding down) with a minus-sign after the comma, that means that it is rounding up.
As a matter of fact, you use kind of Ceil(3.5,0.5).
(If you delete the minus sign, I think the result wil be 3.5)
(I wonder why the result of Floor(3.5,-0.5) would be 4. maybe 3.5 is a bit more, e.g. 3.5000001?)
why we using Floor Function?
I think floor is the topic, right?
sure, floor is topic but which type of scenario can be use?
Several cases: