Skip to content
Sarj Code Standards

numeric-literal-separators

Group long decimal numeric literals with thousands separators.

Why

Long ungrouped decimal quantities are harder to read and easy to miscount.

Fix

Use three-digit groups such as 10_000_000; retain a named constant when the value has domain meaning.

Examples

Before — flagged The contract is implicit
app/service.py
RATE = 16000
After — preferred The contract is explicit
app/service.py
RATE = 16_000
Autofix output
app/service.py
RATE = 16_000