Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kanhomcake
Contributor III
Contributor III

Issue with Round Function for #,##0.95 Values

hi Qlik community, 

I've tried to understand the function, Round(). I guess it might be a bug but before reporting the case, I would like to try here first, maybe, you can give me a good explanation. The values with Bold, Italic, and Underlined font are the ones, I can't understand and I doubt, if they are arithmetically correct?

NineFiveRound(NineFive, 0.1)Round(NineFive, 0.1, 1)
0.950.91.0
1.952.02.0
2.953.03.0
3.954.04.0
4.955.05.0
5.956.06.0
6.957.07.0
7.958.08.0
8.958.98.9
9.959.99.9
10.9510.910.9
17.9517.917.9
28.9529.028.9
39.9540.040.0
43.9544.044.0
53.9554.054.0
77.9578.078.0
81.9582.082.0
87.9588.088.0
89.9590.090.0
98.9599.099.0
100.95101.0101.0
101.95102.0102.0
102.95103.0103.0
103.95104.0104.0
104.95105.0105.0
105.95106.0106.0
106.95107.0107.0
107.95108.0108.0
108.95109.0109.0
109.95110.0110.0
119.95120.0120.0
357.95357.9357.9

 

Any comment is appreciated 🙂

Thank you 🙂
kanhomcake

5 Replies
Digvijay_Singh

Can you show 3 decimal points in the 'NineFive' field? Just want to check if .95 is something like  .949 actally.

kanhomcake
Contributor III
Contributor III
Author

hi @Digvijay_Singh , 

The original values are exactly as you see in the first column, I load inline, forcing every value ends only with 2 digits, .95, there is no third digit in the original value.

kanhomcake

MayilVahanan

HI @kanhomcake 

Try like below

=Round(357.95 + 0.000000001, 0.1, 1)

https://whatis.techtarget.com/definition/rounding-error

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP

I am not going much into detail of your post and investigate, because it is a know fact and NOT error in qlik. Please read this post: 

https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808

kanhomcake
Contributor III
Contributor III
Author

@tresesco thanks for the link, good explanation there. Luckily, we all IT nerds can understand it. Now, I have to explain this to business users/self-service users. It could be a challenge, especially, when MS Excel manages to make it arithmetically correct as what we've all learnt in school 😉