Jump to content

Recommended Posts

Posted

Check this out in your Autocad command line:

 

(setq num 12.123456)

 

And here is the result:

12.1235

 

Why is that ? ... it's not return the same number which is 12.123456

And I tried to inserted into a text, and it come like this:

(vl-cmdf "text" pause "" "" num)

12.12345600000000

 

Regards

 

Michaels

Posted

The sysvar LUPREC controls the decimal accuracy that is displayed on the screen. It doesn't change the value of the variable, just the display mode.

 

You do need to keep in mind the ACAD REALs are limited to 15 significant places. I think LUPREC is still limited to 8 places. So when comparing REALs, look into the (equal) function in lieu of (=). -David

Posted

And I tried to inserted into a text, and it come like this:

 

If you are interested in retrieving the value as a string, then do something like this:

 

(rtos num 2 16), which in your example should return "12.1234560000000"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...