Convert Float into Integer

Ahmad
✭
Hello everyone
Can anyone please tell me how to convert float number into integer number in RAPID (RobotStudio).
For Example if ==> nPassOffs_Y:= ((2-1)/4) = 0.25 then i only need the 0. I jsut want to drop the decimal part. IS THAT Possible in RAPID?
Thanks in advance
Ahmad
????
0
Comments
-
Hi Ahmad,Use the Truncate function:nPassOffs_Y:= Trunc((2-1)/4);ornPassOffs_Y:=Trunc(nPassOffs_Y);BR,Shane0
-
Thanks Shane for your helpI will try thatthanks agianAhmad????0
-
you can use "trunc" to convert to interger (or use "Round" if you need a rounded number) .Or you can also use DIV for integer division.nPassOffs_Y:= ((2-1) DIV 4)0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 300 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 828 RAPID Programming
- 12 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings