Rounding a text string

ffejgreb

Usenet Archive
Joined
Jun 30, 2003
Messages
93
Reaction score
0
I've asked this in the past and reviewed several other posts concerning this, but I just can't figure out how to make it work. I've written a routine that is to select a polygon, capture it's area, then create a string of text using that area. Here is what I have:

(defun c:sft (/ b1 p1 h1)
(setq b1 (entsel))
(command ".area" "e" b1)
(setq b1 (getvar "area"))
(setq p1 (getpoint "\nPick start point for CENTER Justified text: ")) (setq h1 (getdist "\nText height: ")) (command ".text" "j" "c" p1 h1 "0" b1) (princ)
)

The problem is that the value of b1 has 12 places to the right of the decimal and I would like it to have only two. Can someone please help me correct this?

Thank again for your help,

Jeff
 
That worked. Thanks a bunch. I'm still very new to programming in lisp and had seen other responses where rtos and atof were used in and it wasn't working for me. I'll keep plugging away.
 
I hate it when spell checker removes a word. That should say "rtos and atof were used in conjunction..."
 
HI ffejgreb,where you find e and what "e" ?

Command: area
Specify first corner point or [Object/Add/Subtract]: e
 

Latest threads

Back
Top