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.
What EkLine flags
Section titled “What EkLine flags”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.
How to fix
Section titled “How to fix”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.
Does this rule apply to code?
Section titled “Does this rule apply to code?”No. In code, a minus sign must stay a hyphen to run, so keep the hyphen and ignore the rule for that line.
Rule details
Section titled “Rule details”| Property | Value |
|---|---|
| Rule ID | EK00034 |
| Category | Spelling and grammar |
| Default severity | Error |
| Enabled by default | Yes |
Ignore this rule
Section titled “Ignore this rule”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.