Automattic / Automattic/harper

feat: flag European-style switching of commas for decimals and periods for thousands separators

Open
#887 3 comments 4 reactions 0 assignees View on GitHub
enhancement harper-core linting punctuation
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

## Description

English uses the period `.` for decimals: `3.141592654` and the comma `,` for thousands separators: `$1,000,000,000`
But many European languages do the exact opposite. Many Europeans don't know this or forget it when writing in English and write instead `3,141592654` and `$1.000.000.000`

## Resources

- [Wikipedia: Decimal separator](https://en.wikipedia.org/wiki/Decimal_separator)

## Examples

- **3,141** - What is that? Pi or Three thousand one hundred forty-one? I'm sure it's Pi!
- For example, 1 million can be written: English: 1,000,000.00; Spanish: **1.000.000,00**; ISO 31-0: 1 000 000.00
- Worse still: in Germany we officially separate thousands with the decimal point, one million would be **1.000.000** (or **1.000.000,0** as a float)

## Potential False Positives

One potential gotcha is with Indian English, where `,` is used a bit differently to English because in large numbers some groups can be two instead of three. This is related to the use of lakhs and crores in Indian English numbers.

Contributor guide

Open the contributing guide

Research direction

The issue names no source files, tests, or entry points. Start by locating existing numeric-format checking rules and their tests, then determine how decimal and thousands separators are represented and distinguished from Indian English and other valid usage. Done means the intended European-style switching is flagged without the listed false positives.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.