Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: javascript
i18nlocalizationformattingcorrectness
Format numbers and dates with a locale matching the actual audience
Choose a locale (or explicit formatting) that reflects your users' conventions rather than borrowing an unrelated locale that happens to look similar.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | value.toLocaleString('hr-HR'); // app audience is Norwegian |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // Use the audience's locale or explicit grouping/decimal separators |
| 2 | formatNorwegianNumber(value); |
Explanation (EN)
Objašnjenje (HR)