Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
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!