Skip to content

Use an en dash for negative numbers (EK00034)

A negative number reads correctly with an en dash rather than a hyphen, keeping numeric values in documentation typographically precise. Learn why.

Typographic style sets a negative sign as an en dash (–), so write a negative number with an en dash rather than a hyphen. EkLine flags a negative number formed with a hyphen (rule EK00034).

Why write negative numbers with an en dash?

Section titled “Why write negative numbers with an en dash?”

A hyphen and an en dash look similar but carry different meaning, and a negative value deserves the wider en dash that readers recognize as a minus sign. Using the correct character keeps numeric values in specifications and tables typographically precise. Consistent negative signs also prevent a value from being misread as a range or a list marker.

EK00034 matches a negative number written with a hyphen where an en dash belongs.

  • Incorrect: The sensor reports -40 at the low end.
  • Correct: The sensor reports –40 at the low end.
  • Incorrect: Apply a -5 offset to the baseline.
  • Correct: Apply a –5 offset to the baseline.

Replace the hyphen before the number with an en dash (–).

What character should a minus sign use in prose?

Section titled “What character should a minus sign use in prose?”

Use an en dash (–) for a negative value in prose, such as “–40”. A hyphen looks similar but reads as a joiner rather than a minus sign.

No. In code, a minus sign must stay a hyphen to run, so keep the hyphen and ignore the rule for that line.

PropertyValue
Rule IDEK00034
CategorySpelling and grammar
Default severityError
Enabled by defaultYes

To keep a hyphen-minus on one line, add an inline comment:

<!-- ekline-ignore-next-line EK00034 -- minus sign inside code must stay a hyphen -->
Set the offset to `-5` in the config.

To disable the rule across your project, add it to the ignore list in your configuration file.

  • EK00032 — Use an em dash instead of an en dash
  • EK00028 — Avoid spaces before or after a dash