Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

rounding downward in round()

Hello all im new in QV.

im using round() to round up or down numbers. but now i need to round down number ending with .005
In QV help it says "If x is exactly in the middle of an interval, it is rounded upwards" Is it possible to do it in round(). Or should i use floor()?

1 Solution

Accepted Solutions
Not applicable
Author

Hi

You can try

=round(0.005,-0.01)

That gives 0.00

=round(0.005,0.01)

That gives 0.01

Regards

Anders

View solution in original post

5 Replies
Not applicable
Author

Hi

You can try

=round(0.005,-0.01)

That gives 0.00

=round(0.005,0.01)

That gives 0.01

Regards

Anders

IAMDV
Luminary Alumni
Luminary Alumni

Rounding Upwards

ceil( x [, base [, offset ]])

Rounding of x upwards to the nearest multiple of base with an offset
of offset.

ceil( 2.4 ) returns 3

Rounding Downwards

floor( x [ , base [ , offset ]] )

Rounding of x downwards to the nearest multiple of base with an
offset of offset.

floor( 2.4 ) returns 2

I hope this helps.. Please mark the post answered if this helps!

Not applicable
Author

thanks everyone. Specially Ansch. Your solution working perfect ^^

arngue
Contributor III
Contributor III

This won't round down, just will omit the 3rd decimal value and in this case the result is a rownddown but if you wanna to rownddown without decimals won't work, yo'll had to do other thing.
deepikashinde
Contributor
Contributor

Hi,

 

what if we want round value less if value is x.5 and greater than x.5 then upper value

e.g:

Value is 2.5  should return  2

Value is 2.6 should return 3