Skip to content
Novus Examples
json5.2 KB

Locale Number Formats — twelve locales with documented traps (JSON)

The structured twin of the number-format table, plus four documented traps: es-ES's minimumGroupingDigits=2 (which leaves a four-digit integer ungrouped), the four non-ASCII group separators, the arab numbering system's own digits, and the seven locales here whose decimal separator is a comma.

Preview — first 50 linesjson
{
  "note": "Assert on the pattern, the separator code points and the fraction-digit counts. The rendered example strings are illustrative: CLDR revises month abbreviations and spacing between releases, so a byte comparison against them will eventually fail for reasons that are not your bug.",
  "sampleValue": 1234567.89,
  "locales": [
    {
      "locale": "en-US",
      "language": "English (United States)",
      "groupSeparatorName": "COMMA",
      "groupSeparator": ",",
      "decimalSeparator": ".",
      "formatted": "1,234,567.89",
      "numberingSystem": "latn"
    },
    {
      "locale": "en-GB",
      "language": "English (United Kingdom)",
      "groupSeparatorName": "COMMA",
      "groupSeparator": ",",
      "decimalSeparator": ".",
      "formatted": "1,234,567.89",
      "numberingSystem": "latn"
    },
    {
      "locale": "en-IN",
      "language": "English (India)",
      "groupSeparatorName": "COMMA (3,2,2 grouping)",
      "groupSeparator": ",",
      "decimalSeparator": ".",
      "formatted": "12,34,567.89",
      "numberingSystem": "latn"
    },
    {
      "locale": "de-DE",
      "language": "German (Germany)",
      "groupSeparatorName": "FULL STOP",
      "groupSeparator": ".",
      "decimalSeparator": ",",
      "formatted": "1.234.567,89",
      "numberingSystem": "latn"
    },
    {
      "locale": "de-CH",
      "language": "German (Switzerland)",
      "groupSeparatorName": "U+2019 RIGHT SINGLE QUOTATION MARK",
      "groupSeparator": "’",
      "decimalSeparator": ".",
      "formatted": "1’234’567.89",
      "numberingSystem": "latn"
    },
    {
168 lines total — download for the full file.

Specifications

Locales
12
Traps
4
Sample Value
1234567.89
Numbering Systems
latn, arab
Minimum Grouping Digits
documented for es-ES
Seed
20260807
Wave
p7
Line Endings
LF

Testing contract

Reference control
Scenario
Drive an Intl.NumberFormat / ICU / CLDR comparison from the `locales` array and assert each trap in `traps` separately.
Expected result
Every locale entry's `formatted` value is reproduced from its own separators, and es-ES renders 1234 as '1234' while en-US renders it as '1,234'.

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

How to use this file for testing

“Locale Number Formats — twelve locales with documented traps (JSON)” is a deterministic Novus Examples fixture for Internationalization, JSON parsing, Encoding detection. Parallel text and accented, multi-script content — for testing translation pipelines, Unicode handling, and localization tooling.

Documented properties for this file: seed 20260807 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Translation-catalog fixtures carry the same message set across formats, each with its native placeholder syntax. Test your i18n loader, catalog converter, or translation-memory tool, and use the RTL and CJK variants to check bidirectional text and Unicode handling.

Load the catalog with your i18n framework and verify placeholder interpolation and plural handling; the RTL and CJK variants exercise bidirectional text and font fallback.

Code examples

import json

with open("number-formats.json") as f:
    data = json.load(f)
print(type(data), len(data))

Generated by generation/localization_p7.py. Free for any use, no attribution required — license.