سبع الليل Posted August 17, 2017 Share Posted August 17, 2017 hi guys how do you do in excel we write this function =ceiling (number; 05) for examble in autolisp what is the same function to do this ?? I.E : if i have a number ( 2.63) ... and i want the cad give it as ( 2.65) what must i use ?? i assumed i can use (ceiling 2.63 0.05) but it is bad function thank you and sorry for my bad english Quote Link to comment Share on other sites More sharing options...
ReMark Posted August 17, 2017 Share Posted August 17, 2017 Rounding Functions in autolisp as presented by Lee Mac. http://lee-mac.com/round.html Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2017 Share Posted August 17, 2017 Consider the following function: ;; Round Up - Lee Mac ;; Rounds 'n' up to the nearest 'm' (defun LM:roundup ( n m ) (cond ((equal 0.0 (rem n m) 1e- n) ((< n 0) (- n (rem n m))) ((+ n (- m (rem n m)))) ) ) Example of usage: _$ (LM:roundup 2.61 0.05) 2.65 Quote Link to comment Share on other sites More sharing options...
سبع الليل Posted August 22, 2017 Author Share Posted August 22, 2017 thank you alot you are awesome people Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.