Civil 3D: How to Suppress Decimal Values for Contour Labels

November 30, -0001 Leo Lavayen

For a long time, I have wanted to have a smarter Contour label that drops decimals.  Something like what is available for Stations type labels.  A modifier that could “Drop Decimal Value for whole numbers

 


ISSUE:

In Civil 3D, Contour surface labels do not support conditional formatting for decimal precision.  If a label style is set to display two decimal places, those decimals will appear for all elevations—even when the value is a whole number (e.g., 100.00 instead of 100).


SOLUTION:

We can work around this limitation by using expressions and dual text components to conditionally display whole numbers and decimal values.

Step 1: Create Expressions

First, create expression that will check if there is a whole number:

Name:  Math
Description:  Check for Decimal
Expression:  {Surface Elevation}-TRUNC({Surface Elevation})

Then, create two expressions that control text height based on whether the elevation is a whole number.

Expression to Hide whole value

 Expression to Show Decimal value

Name:  Hide_Decimal
Description:  Compares Values controls Height
Expression:  IF(Math=0,0,0.1/12)

Name:  Show_Decimal
Description:  Compares Values controls Height
Expression:  IF(Math=0,0.1/12,0)

 

Step 2: Create Label Style

Create a contour label style with two text components:

    1. Whole Value Component: 
      Decimal precision: 0 - Uses expression: Hide_Decimal
    2. Decimal Value Component: 
      Decimal precision: 2 - Uses expression: Show_Decimal

“Whole” text component: 0 decimal spaces

“Decimal” text component: 2 decimal spaces

 


Each text component is conditionally hidden by setting its height to zero. When the elevation is a whole number, only the whole-value component is visible. When it includes decimals, only the decimal component appears.  This setup is especially useful when:

    • Contour intervals include fractional values
    • Surface analysis requires mixed precision labeling
    • You want cleaner, more readable contour annotations

About the Author

Leo Lavayen

Civil Applications Expert<br><br>As an Applications Expert, Leo is responsible for supporting, training and implementation of software for survey and civil engineering professionals. He has more than 20 years of experience helping large and small, public and private clients in the eastern United States.

More Content by Leo Lavayen
Previous Article
Dimensions - Using Different Suffixes in same style
Dimensions - Using Different Suffixes in same style

Create a dimension style that uses a foot mark suffix for linear dimensions and no suffix for radius or dia...

Next Article
Fixing Civil 3D Labels That Randomly Move or Disappear
Fixing Civil 3D Labels That Randomly Move or Disappear

Issue: Labels in Civil 3D: shift position unexpectedly, disappear after regen or reopen, lose leaders or fl...

×

Get Tips Delivered.

Subscribe to Email Updates.

First Name
Last Name
Country
Thank you!
Error - something went wrong!