PDA

View Full Version : How to "trim" numbers in Lisp


jkramer
01-20-2003, 06:29 AM
Hi,

I'm writing a Lisp routine that produces an ASCII list of all the round holes in the flat view of a drawing.
Here's an example of the output:
Diameter;X-coordinate;Y-coordinate
4.2999799999360002;206.90503034145198;139.53199609113381
3.5999799999461803;171.39749935552396;129.34448250634
5.1999799999224399;199.39921003322698;157.34619318403981
5.1999799999223999;247.48121003250799;109.2641931847557
4.2999999999359204;231.21901518614598;125.5263880311189

It works fine, but, as you can see the numbers have up to 16 digits behind the decimal point. I'd like to have 1 or 2.
Is there a trick to "trim" the numbers?
Thanks!
Jaap Kramer

Markus
01-20-2003, 10:41 PM
You can use SD-NUM-TO-STRING to reduce the number of digits after the decimal point.

Markus