eplisp

Set Decimal Places of Numeric Text

eplisp, the free multilingual LISP library

Set Decimal Places of Numeric Text
Openly licensed; the original file is hosted here together with its license.
…
Rate this tool:
CommandsPDEC
CategoryText Tools
AuthorBGol Community
Sourcethevijayparmar/bgol-cad-lisps
LicenseMIT
RequirementsAutoCAD (full version, not LT), BricsCAD; no Express Tools needed.
Prompt languageEnglish
FilesPREC-bgol.lsp (4 KB)
Added2026-10-26
Download the original fileSource repository

PDEC rewrites the value of selected numeric TEXT objects to a fixed 1 to 4 decimal places, giving elevation and coordinate labels one consistent format.

PDEC is an AutoLISP routine for making the decimal precision of numeric labels consistent. Elevation, coordinate or dimension callouts collected from different sources often mix 2 and 3 decimals; PDEC brings them to one format in a single command. It is aimed at drafters working on survey, infrastructure and grading drawings.

Overview

The command first asks for a precision from 1 to 4, then for TEXT objects. Texts whose content consists only of digits, periods and plus or minus signs are converted to a number and rewritten with the chosen number of decimals; all other texts are left unchanged. A POINT object is placed just above each changed text on layer BGOL-PDEC as an audit marker, and the number of updated texts is reported.

How to use it

  1. Load PREC-bgol.lsp with APPLOAD.
  2. Type PDEC at the command line.
  3. Enter the number of decimal places (1-4).
  4. Select the numeric TEXT objects and press Enter.

Notes and limitations

  • Only single-line TEXT objects are processed; MTEXT, dimensions and attributes are not selected.
  • Texts that contain units, prefixes or a comma decimal separator (e.g. '+12,50 m') are not treated as numeric and are left alone.
  • The value is written with AutoCAD's rtos function; if DIMZIN suppresses trailing zeros, the result can be shorter than expected.
  • A POINT is added on layer BGOL-PDEC for every changed text; delete or freeze that layer when you are done.
  • License: the repository's LICENSE file is MIT; the file header also states the code is free to use, modify and share.
  • The repository was published in 2026 and the amount of testing is not stated; try it on a copy of the drawing first.

Source and license

This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.

References

  1. Source repository: thevijayparmar/bgol-cad-lisps – https://github.com/thevijayparmar/bgol-cad-lisps/tree/3acbe32f71b489f4c81dcd9372f989591a9be858/Text%20Lisps/Change%20Precision
  2. Author: BGol Community – https://bgol.in/
  3. License: MIT – https://github.com/thevijayparmar/bgol-cad-lisps/blob/3acbe32f71b489f4c81dcd9372f989591a9be858/LICENSE

Found a mistake, or are you the author of this tool? Request a correction or removal