AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

number of decimals after comma

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
1803 Views, 3 Replies

number of decimals after comma

I excute a query to extract the elevations of some GPS points as text.

Problem:
I want to show only 2 decimals after the comma....
Map shows me all 8 decimals!

I even modified FORMAT--->UNITS... (precision 0,00) but I obtained the same
results

Any suggestions?
Thanks Paolo
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

In the alter properties dialog, when you define the text value expression
you can format the text using lisp syntax.

(rtos .ELEVATION 2 2)

RTOS is a lisp function to convert a real value to a string value.
The RTOS function takes three arguments.
A real number, the conversion mode and the decimals of precision

".ELEVATION" is the AutoCAD Map expression that returns a real value.
The first 2 is the conversion mode that specifies a decimal number
conversion
The second 2 specifies 2 digits of precision.

This should get you the elevation formated with only two characters after
the decimal point.

Cheers,
Will Crichton

"Paolo" wrote in message
news:758A9EAE16ECB0B0910DD18BEC743B42@in.WebX.maYIadrTaRb...
> I excute a query to extract the elevations of some GPS points as text.
>
> Problem:
> I want to show only 2 decimals after the comma....
> Map shows me all 8 decimals!
>
> I even modified FORMAT--->UNITS... (precision 0,00) but I obtained the
same
> results
>
> Any suggestions?
> Thanks Paolo
>
>
>
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

Perfect!
It's just what I was looking for!!
Thanks very much Will!
Paolo

"Will Crichton" ha scritto nel messaggio
news:C5F34755D3B126FB621CB4598CD4E819@in.WebX.maYIadrTaRb...
> In the alter properties dialog, when you define the text value expression
> you can format the text using lisp syntax.
>
> (rtos .ELEVATION 2 2)
>
> RTOS is a lisp function to convert a real value to a string value.
> The RTOS function takes three arguments.
> A real number, the conversion mode and the decimals of precision
>
> ".ELEVATION" is the AutoCAD Map expression that returns a real value.
> The first 2 is the conversion mode that specifies a decimal number
> conversion
> The second 2 specifies 2 digits of precision.
>
> This should get you the elevation formated with only two characters after
> the decimal point.
>
> Cheers,
> Will Crichton
>
> "Paolo" wrote in message
> news:758A9EAE16ECB0B0910DD18BEC743B42@in.WebX.maYIadrTaRb...
> > I excute a query to extract the elevations of some GPS points as text.
> >
> > Problem:
> > I want to show only 2 decimals after the comma....
> > Map shows me all 8 decimals!
> >
> > I even modified FORMAT--->UNITS... (precision 0,00) but I obtained the
> same
> > results
> >
> > Any suggestions?
> > Thanks Paolo
> >
> >
> >
> >
> >
>
>
Message 4 of 4
will_andrews
in reply to: Anonymous

This is exactly how I solved same problem. In my case however, there is only 1 decimal place in database. In one case, the number in Access table is exactly 3.2 I rounded and pasted values in Excess before pasting into Access. My query displays 3.200000048 before using rtos. Other value of 4.7 displays as 4.699999809, so error is not consistent. rtos makes my display right in these cases, but why is this happening? Could there be much larger errors on other blocks?

Any advise is greatly appreciated.

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

Post to forums  

Autodesk Design & Make Report

”Boost