CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Czech English Deutsch
Login/Register:
 Visitors: 4809 
RSS tips RSS channel - CAD tips
RSS discussion RSS channel - CAD discussion

Discussion Discussion forum

HelpCAD discussion

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

AutoLISP change decimal point to comma

 Post Reply Post Reply
Author
lumpy92 View Drop Down
Newbie
Newbie


Joined: 02.Jun.2017
Location: Hungary
Using: AutoCAD2013
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote lumpy92 Quote  Post ReplyReply Direct Link To This Post Topic: AutoLISP change decimal point to comma
    Posted: 10.Aug.2017 at 23:49
Hi everyone!
I am creating a simple command in autoLISP and I have a little problem.
At some point, I give a value for a variable,which is a real number (e.g. 0.3) and the program uses it to draw.
Later the command create a multiline text object and write there those numbers (now 0.30).
In Hungary, we use comma instead of a decimal point and I want my value displayed like this: 0,30.
Can I somehow change the point to a comma?
Thank you very much!
Back to Top
jkaunisto View Drop Down
Newbie
Newbie


Joined: 07.Nov.2011
Location: Finland
Using: AutoCAD 2008
Status: Offline
Points: 16
Post Options Post Options   Thanks (1) Thanks(1)   Quote jkaunisto Quote  Post ReplyReply Direct Link To This Post Posted: 12.Aug.2017 at 08:15
Comma separates two numbers and dot is for decimals. If you want to use Lisp, you have to use dot. If you want to just display (and never use that afterwards for any mathematival purposes) you can change the real-number to text and replace the dot with anything you like. (strcat ....
30 years AutoCAD !
Back to Top
philippe JOSEPH View Drop Down
Senior Member
Senior Member


Joined: 14.Mar.2011
Location: France
Using: AutoCAD Mechanical 2012
Status: Offline
Points: 840
Post Options Post Options   Thanks (1) Thanks(1)   Quote philippe JOSEPH Quote  Post ReplyReply Direct Link To This Post Posted: 12.Aug.2017 at 09:34
Hello, if you want to change decimal point to comma on text you can use FIND with various options : on one specific selection or on the entire drawing ( warnning this can be dangerous ).
If you want to change decimal point to comma on dimentions you only have to set your dimensions for this.
P.S. See Tip 854 right here under.



Edited by philippe JOSEPH - 12.Aug.2017 at 09:35
Philippe JOSEPH
Back to Top
lumpy92 View Drop Down
Newbie
Newbie


Joined: 02.Jun.2017
Location: Hungary
Using: AutoCAD2013
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote lumpy92 Quote  Post ReplyReply Direct Link To This Post Posted: 14.Aug.2017 at 16:14
Thank you, I managed to solve the problem with substr and strcat.
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,063 seconds.