Controlling the Number of Decimals Used in a Text Macro


Reference Number: KB-01897
Last Modified: October 7, 2025

QUESTION

I would like to use a text macro in my room labels, but it displays several decimal points. How can I make it display fewer decimal places?  


ANSWER

By default, many text macros are setup to simply display the raw, unrounded results of the calculation they perform, but you can easily modify the macro to round down to the nearest value of your choosing. 

In this example, we will copy the already-defined RoomVolume text macro and modify it to have two decimal places. 

Note: If you would like custom text macros to be present in all files that you create, consider making the changes below to your template(s). For more information on templates, please see the Related Articles section below. 


To create a custom macro that is rounded to a specified number of decimal places

  1. Access the plan or template that you would like to create a new macro within.

    In this example, we have drawn a single room structure that measures 15' x 15' on the interior from surface to surface. 

    Basic structure measuring 15' x 15' on its interior


  2. Using the Select Objects  tool, click in the single room to select it, and with it selected, navigate to CAD> Text> Text Macro Management  from the menu.

    Although selecting a room or object isn't necessary when creating or customizing macros, it can prove to be helpful, as the Text Macro Management dialog will provide a result if the macro successfully functions with the selected room or object. 


  3. In the Text Macro Management dialog that opens, select the "RoomVolume" macro in the list on the left, then click Copy.


  4. In the Edit Text Macro dialog that displays next:

    Edit Text Macro dialog

    • Provide a reasonable Name

      In this example, RoomVolumeRounded is specified. 

    • Insert the following Value:

      (internal_area * (ceiling_elevation - floor_elevation) ).to_cu_ft.round(2)

    • You may have noticed that the only change from the initial RoomVolume macro is the addition of .round(2). By calling the round function with an argument of 2, we are telling the program to round the volume down to two decimal places. 

      Note: If a room is not selected prior to accessing the Text Macro Management dialog as mentioned in Step 2 above, the Original Result and New Result fields in the Edit Text Macro dialog will instead display with Evaluation Errors. This does not mean the macro will not function correctly when used, just that it can't perform the function as an applicable room was not selected. 


    • Click OK once the macro has been established to your liking, and notice that it's now displayed in the list of macros.


  5. Click OK again to close out of the Text Macro Management dialog. 


  6.  Navigate to Edit> Default Settings , expand the Floors and Rooms category, select Room Label from the list, then click Edit.

    Default Settings with Room Label selected


  7. On the Text panel of the Room Label Defaults dialog that opens:

    RoomVolumeRounded macro defined in the Room Label Defaults dialog

    • Press Enter on the keyboard to drop to the second line in the text box.

    • Type %RoomVolumeRounded%, which is the name of the macro we just created.

    • Click OK and Done to close the dialogs and confirm the change.


  8. Next, click inside of the room using the Select Objects tool, then select the Open Object edit tool.


  9. On the General panel of the Room Specification dialog that displays, change the Room Type to Living or something else from list of room types, then click OK.

    Note: If automatic room labels have already been populated prior to creating and inserting a Macro, the labels may need to be refreshed. This can be done by opening one or more rooms up to specification, making a change to the Room Type or Room Name, then clicking OK. Once the room labels have been refreshed, you can revert the change made to the Room Type or Room Name.


    Specify a Room Type on the General panel of the Room Specification dialog


The room's label will now display, along with the volume rounded to two decimal places. 

Room volume rounded to two decimal places


You can apply these same concepts to other custom macros to achieve similar results.