Jump to content

Simple Lisp to convert inches to millimeter


Recommended Posts

Posted

Ok I'm new to LISP. I'm trying to get a simple LISP to convert a number in inches to mm and and also the other way around a number in mm to inches.

 

Thanks for the help

Posted

why do you want a LISP? Isn't the built in calculator (with its own conversion tables) sufficient?

Posted

It is sufficient but I'm just working on using LISP and I was just wondering if there is a LISP for that.

Posted (edited)

Do you mean you want to change a dimension that is in inches into mm and vice versa? If not then, inches to mm:

^c^cUserr1;\$M=$(*,$(getvar,userr1),25.4)

mm to inches:

^c^cUserr2;\$M=$(/,$(getvar,userr2),25.4)

They're not lisp but they will return the value of the dimension in the command line.

 

Updated: I didn't like USERI1 that much so I changed it to USERR1.

Edited by Tuns
Posted

I've moved your question to the Lisp section. For best results, try to post your question in the correct area of the forum. ;)

Posted
(defun mm-to-inches (mm)
 (/ mm 25.4)
)

Excuse me for saying so, but it seems that this is a very simple conversion to be asking for. Are you new to programming as well? Are you availing yourself of the tons of help on this and other related sites?

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...