def _format_read_number(read, read_type=None):
    """
    Catch read values without a letter prefix (legacy format), convert
    them to Rn format. This could be fixed by a database migration that
    updates the JSON blobs.

    :param read: The read number. May be eg 'R1', 'R2', 'I1', or
                 the old format used previously, '1', '2', '3'
                 (as string or int).
    :type read: str | int
    :return: The read number properly formatted for output - Rn or In.
    :rtype: str
    """
    try:
        read = int(read)
        if read_type is None:
            read_type = 'R'
        read = '%s%s' % (read_type, read)
    except ValueError:
        # read is in the format 'Rn' or 'In', so just return it unmodified
        pass
    return read