Skip to content
Novus Examples
json4 KB

Locale Currency Formats — minor units and invisible separators (JSON)

The structured currency table with the three traps spelled out: minor units belong to the CURRENCY not the locale (JPY 0, USD 2, KWD/BHD/JOD 3), the gap before a trailing symbol is U+00A0 in six of these locales, and CLDR's ar-EG pattern contains an invisible U+200F that breaks naive equality assertions.

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": 12345.6,
  "locales": [
    {
      "locale": "en-US",
      "currency": "USD",
      "fractionDigits": 2,
      "formatted": "$12,345.60",
      "symbolPlacement": "symbol before, no space"
    },
    {
      "locale": "en-GB",
      "currency": "GBP",
      "fractionDigits": 2,
      "formatted": "£12,345.60",
      "symbolPlacement": "symbol before, no space"
    },
    {
      "locale": "en-IN",
      "currency": "INR",
      "fractionDigits": 2,
      "formatted": "₹12,345.60",
      "symbolPlacement": "symbol before, no space; 3,2,2 grouping above 5 digits"
    },
    {
      "locale": "de-DE",
      "currency": "EUR",
      "fractionDigits": 2,
      "formatted": "12.345,60 €",
      "symbolPlacement": "symbol after, separated by U+00A0"
    },
    {
      "locale": "de-CH",
      "currency": "CHF",
      "fractionDigits": 2,
      "formatted": "CHF 12’345.60",
      "symbolPlacement": "ISO code before, separated by U+00A0"
    },
    {
      "locale": "fr-FR",
      "currency": "EUR",
      "fractionDigits": 2,
      "formatted": "12 345,60 €",
      "symbolPlacement": "symbol after; group U+202F, gap U+00A0"
    },
    {
      "locale": "es-ES",
      "currency": "EUR",
      "fractionDigits": 2,
128 lines total — download for the full file.

Specifications

Locales
11
Traps
3
Sample Value
12345.60
Minor Unit Range
0 (JPY) to 3 (KWD, BHD, JOD)
Rtl Pattern Note
ar-EG carries U+200F in CLDR's own pattern
Seed
20260807
Wave
p7
Line Endings
LF

Testing contract

Reference control
Scenario
Convert each amount to integer minor units using the per-currency exponent, then format back and compare.
Expected result
JPY round-trips through 12346 minor units with no decimal point while USD round-trips through 1234560; a hard-coded factor of 100 breaks both JPY and the three-decimal currencies listed in the traps block.

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 Currency Formats — minor units and invisible separators (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("currency-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.