Function licenseToReadablePlate

  • Converts a raw license plate string into a human-readable Persian license plate format.

    The license string is divided into segments (first two digits, character code, three digits, and Iran code). The character code is mapped to a Persian letter using the PLATE_LETTER mapping.

    Parameters

    • license: string

      The raw license plate string (expected to be at least 9 characters).

    Returns string

    The formatted, human-readable license plate string.

    const result = licenseToReadablePlate("123456789");
    console.log(result); // "12"ب"345-ایران89"
    const result = licenseToReadablePlate("98765AB43");
    console.log(result); // "98"الف"765-ایران43"