# Use an en dash for negative numbers (EK00034)

import { Aside, Badge } from '@astrojs/starlight/components';

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?

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

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

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

<Aside type="note">
In code, a minus sign is written as a hyphen and must stay that way to run. When a negative value appears inside code, keep the hyphen and ignore the rule for that line.
</Aside>

## FAQ

### 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?

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

| Property | Value |
|----------|-------|
| Rule ID | `EK00034` |
| Category | Spelling and grammar |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | Yes |

## Ignore this rule

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

```markdown
<!-- 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](/reviewer/configuration/ignoring-rules/#ignore).

## Related rules

- [EK00032](/reviewer/rules/em-dash/) — Use an em dash instead of an en dash
- [EK00028](/reviewer/rules/spaces-around-dashes/) — Avoid spaces before or after a dash