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: 
JackTheRipper
Contributor
Contributor

Floor Function Error

I'd like to use the floor function to truncate a number with 2 decimal, so I used the script with the floor function

floor(X, 0.01) as VAR

everything worked fine BUT whit the number 1,17 the function floor converted the value in 1,16

all the other number has been truncated correctly 

this is an example of the numbers converted

raw number function floor(x,0.01)
7,35555 7,35
7,34 7,34
7,342121 7,34
1,17 **1,16** ?? why ??
1,010101 1,01
0,1515 0,15

 

why the number 1,17 is truncated to 1,16???????

all the other number are correct but why the 1,17 is wrong truncated?

Thanks very much

 

Labels (4)
1 Solution

Accepted Solutions
JackTheRipper
Contributor
Contributor
Author

Maybe I found the solution...

floor(X*100)/100 as VAR

and the value 1,17 remain 1,17 all the other value are truncated correctly

 

Many Thanks!

View solution in original post

1 Reply
JackTheRipper
Contributor
Contributor
Author

Maybe I found the solution...

floor(X*100)/100 as VAR

and the value 1,17 remain 1,17 all the other value are truncated correctly

 

Many Thanks!