585,585 active members*
3,650 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Posts
    24

    Round Numbers

    16i Control
    Is it possible to round a machine position, #5021-#5024, to 4 decimal places and store in common variables table. If so how?
    Thanks a million!!

  2. #2
    Join Date
    Jan 2006
    Posts
    7

    Try this

    Have you tried:

    #500=ROUND[#5021]

    Never had to do this but it should work.

    #500=ROUND[#5003] WOULD BE FOR CURRENT Z POSITION
    #501=ROUND[#5002] WOULD BE FOR CURRENT Y POSITION
    #502=ROUND[#5001] WOULD BE FOR CURRENT X POSITION

  3. #3
    Join Date
    Feb 2005
    Posts
    24

    I did, no luck

    It rounds to nearest whole number, I need to be closer than that.

  4. #4
    Join Date
    Jan 2006
    Posts
    7

    No round

    How about

    #500=#5001 for current x position and so on for y and z with no rounding used? That should give you a number with four places after the decimal.

  5. #5
    Join Date
    Sep 2006
    Posts
    1
    What you need to do is pull the number you are looking for, (#5021-#5024) for instance, into a variable (#500 = #5021). Then multiply that variable by 10, 100, 1000, 10000 depending on how far out you want to round. I.E. #500 = #500 * 1000. This will get you to the digit you want to round to. Then perform the ROUND command on that variable (#500 = [ROUND#500] ). And then divide by the number you previously multiplied by (#500 = #500 / 1000).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •