Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change displayed precision of numbers?

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
760 Views, 7 Replies

How to change displayed precision of numbers?

I keep forgetting this one.
Luprec doesn't affect the display of units on command line or vlisp editor.
What sys var changes the display of units?
This is a list defined in dwg.
(setq StationList
(list
10195.17 637.27
10199.17 637.43
10210.19 637.86
10212.19 637.94
10223.22 638.33
10225.22 638.40
));temporary truncated list

this is the display in vlisp editor
_$ (getvar"luprec")
8
_$ stationlist
(10195.2 637.27 10199.2 637.43 10210.2 637.86 10212.2 637.94 10223.2 638.33
10225.2 638.4)

why is it rounding the first number of each pair and not the second?

autocad supposedly uses 14 or 16 decimal places(according to various posts)
but apparently you can never display that many, is that right?
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

The numbers are really not rounded. If you use them in calculations full
accuracy will be used.
Test this expression:

(rtos (car stationlist) 2 3)

This will give you "10195.17"

Alf

"MP" skrev i meddelandet
news:CB1957A14C6DF1356A95B186EC80C48D@in.WebX.maYIadrTaRb...
> I keep forgetting this one.
> Luprec doesn't affect the display of units on command line or vlisp
editor.
> What sys var changes the display of units?
> This is a list defined in dwg.
> (setq StationList
> (list
> 10195.17 637.27
> 10199.17 637.43
> 10210.19 637.86
> 10212.19 637.94
> 10223.22 638.33
> 10225.22 638.40
> ));temporary truncated list
>
> this is the display in vlisp editor
> _$ (getvar"luprec")
> 8
> _$ stationlist
> (10195.2 637.27 10199.2 637.43 10210.2 637.86 10212.2 637.94 10223.2
638.33
> 10225.2 638.4)
>
> why is it rounding the first number of each pair and not the second?
>
> autocad supposedly uses 14 or 16 decimal places(according to various
posts)
> but apparently you can never display that many, is that right?
>
>
>
Message 3 of 8
Anonymous
in reply to: Anonymous

Yes, I understand this. The computations aren't rounding the number...the
*Display* *IS* rounding the number!!!
I'm asking how to make the "display" display a correct value instead of an
incorrect value.
For as much as this program costs it's absurd that it tells me a number is
10195.2 when it is in fact 10195.17!!!!!!!
And if no one comes up with an answer that means there's not even a setting
I can change to make it display correctly?????
Geeeezzzzeee.
(whinewhinewhine - hey it's monday, what do you expect?)

"Alf" wrote in message
news:9336069A8A770691FA0A520DB4C97971@in.WebX.maYIadrTaRb...
> The numbers are really not rounded. If you use them in calculations full
> accuracy will be used.
> Test this expression:
>
> (rtos (car stationlist) 2 3)
>
> This will give you "10195.17"
>
> Alf
>
> "MP" skrev i meddelandet
> news:CB1957A14C6DF1356A95B186EC80C48D@in.WebX.maYIadrTaRb...
> > I keep forgetting this one.
> > Luprec doesn't affect the display of units on command line or vlisp
> editor.
> > What sys var changes the display of units?
> > This is a list defined in dwg.
> > (setq StationList
> > (list
> > 10195.17 637.27
> > 10199.17 637.43
> > 10210.19 637.86
> > 10212.19 637.94
> > 10223.22 638.33
> > 10225.22 638.40
> > ));temporary truncated list
> >
> > this is the display in vlisp editor
> > _$ (getvar"luprec")
> > 8
> > _$ stationlist
> > (10195.2 637.27 10199.2 637.43 10210.2 637.86 10212.2 637.94 10223.2
> 638.33
> > 10225.2 638.4)
> >
> > why is it rounding the first number of each pair and not the second?
> >
> > autocad supposedly uses 14 or 16 decimal places(according to various
> posts)
> > but apparently you can never display that many, is that right?
> >
> >
> >
>
>
Message 4 of 8
Anonymous
in reply to: Anonymous

"Mark Propst" wrote:
> SNIP <
> I can change to make it display correctly?????
> Geeeezzzzeee.
> (whinewhinewhine - hey it's monday, what do you expect?)
>
> SNIP <

Someone need a nap?

Anyway, I tried creating your list at the command line. I thought maybe it
was VLisp doing it. Same result you got... tried changing some
variables... same thing. Don't know.

Have fun,
Dave
Message 5 of 8
Anonymous
in reply to: Anonymous

Alf told you right. You can change the display precision of AutoLisp numeric values only by converting them to strings. Use (rtos)
for distance/coordinate REALS and (angtos) for angular REALS. Leading and trailing zeros are controlled by the value of DIMZIN.

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711


"Mark Propst" wrote in message news:5AE13D02C5C13F56D2301B2476B37FD6@in.WebX.maYIadrTaRb...
> Yes, I understand this. The computations aren't rounding the number...the
> *Display* *IS* rounding the number!!!
> I'm asking how to make the "display" display a correct value instead of an
> incorrect value.
> For as much as this program costs it's absurd that it tells me a number is
> 10195.2 when it is in fact 10195.17!!!!!!!
> And if no one comes up with an answer that means there's not even a setting
> I can change to make it display correctly?????
> Geeeezzzzeee.
> (whinewhinewhine - hey it's monday, what do you expect?)
>
> "Alf" wrote in message
> news:9336069A8A770691FA0A520DB4C97971@in.WebX.maYIadrTaRb...
> > The numbers are really not rounded. If you use them in calculations full
> > accuracy will be used.
> > Test this expression:
> >
> > (rtos (car stationlist) 2 3)
> >
> > This will give you "10195.17"
> >
> > Alf
> >
> > "MP" skrev i meddelandet
> > news:CB1957A14C6DF1356A95B186EC80C48D@in.WebX.maYIadrTaRb...
> > > I keep forgetting this one.
> > > Luprec doesn't affect the display of units on command line or vlisp
> > editor.
> > > What sys var changes the display of units?
> > > This is a list defined in dwg.
> > > (setq StationList
> > > (list
> > > 10195.17 637.27
> > > 10199.17 637.43
> > > 10210.19 637.86
> > > 10212.19 637.94
> > > 10223.22 638.33
> > > 10225.22 638.40
> > > ));temporary truncated list
> > >
> > > this is the display in vlisp editor
> > > _$ (getvar"luprec")
> > > 8
> > > _$ stationlist
> > > (10195.2 637.27 10199.2 637.43 10210.2 637.86 10212.2 637.94 10223.2
> > 638.33
> > > 10225.2 638.4)
> > >
> > > why is it rounding the first number of each pair and not the second?
> > >
> > > autocad supposedly uses 14 or 16 decimal places(according to various
> > posts)
> > > but apparently you can never display that many, is that right?
> > >
> > >
> > >
> >
> >
>
>
Message 6 of 8
Anonymous
in reply to: Anonymous

Hi John,

Can you shed some light on why it is only *rounding* every other one? Seems
they should all be rounded, not just some.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program
Message 7 of 8
Anonymous
in reply to: Anonymous

It's really not rounding every other one. It's just coincidental that the values he used were high/low in pairs coupled with
AutoCAD's default means of efficiency...

Command: (setq a '(0.1234567 10.1234567 100.1234567 1000.1234567 10000.1234567
100000.1234567))
(0.123457 10.1235 100.123 1000.12 10000.1 100000.0)

Maximum 6 numeric characters but at least one character before and after the decimal just so you can recognize it as a REAL.

Command: LUPREC
Enter new value for LUPREC <2>: 8

Command: DIMZIN
Enter new value for DIMZIN <1>: 0

Command: (mapcar 'rtos a)
("0.12345670" "10.12345670" "100.12345670" "1000.12345670" "10000.12345670"
"100000.12345670")

Command: DIMZIN
Enter new value for DIMZIN <0>: 1

Command: (mapcar 'rtos a)
("0.12345670" "10.12345670" "100.12345670" "1000.12345670" "10000.12345670"
"100000.12345670")

Command: DIMZIN
Enter new value for DIMZIN <1>: 8

Command: (mapcar 'rtos a)
("0.1234567" "10.1234567" "100.1234567" "1000.1234567" "10000.1234567"
"100000.1234567")

Command: DIMZIN
Enter new value for DIMZIN <8>: 12

Command: (mapcar 'rtos a)
(".1234567" "10.1234567" "100.1234567" "1000.1234567" "10000.1234567"
"100000.1234567")

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711

"Jason Piercey" wrote in message news:57EE47196C6F66ECF753ABB39AFDE683@in.WebX.maYIadrTaRb...
> Hi John,
>
> Can you shed some light on why it is only *rounding* every other one? Seems
> they should all be rounded, not just some.
>
> --
> -Jason
>
> Member of the Autodesk Discussion Forum Moderator Program
>
>
>
>
Message 8 of 8
Anonymous
in reply to: Anonymous

"John Uhden" wrote:
> It's really not rounding every other one. It's just coincidental that the
values he used were high/low in pairs coupled with
> AutoCAD's default means of efficiency...
>
> snip <

Dang math... forgot about significant digits... going away now...

:O)

Have fun,
Dave

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta