Print Page | Close Window

AutoLISP change decimal point to comma

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=12436
Printed Date: 17.Apr.2026 at 15:44


Topic: AutoLISP change decimal point to comma
Posted By: lumpy92
Subject: AutoLISP change decimal point to comma
Date 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!



Replies:
Posted By: jkaunisto
Date 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 ....


-------------
Almost 40 years AutoCAD !


Posted By: philippe JOSEPH
Date 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.



Posted By: lumpy92
Date Posted: 14.Aug.2017 at 16:14
Thank you, I managed to solve the problem with substr and strcat.



Print Page | Close Window