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
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 304 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 354 IRC5
- 74 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 850 RAPID Programming
- 26 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings