import math


def get_number_format(number_of_pages) -> str:
    """
    Get the correct number formatting for pdftoppm's output numbering. E.g. a file with 10-99 pages will have output
    images named '01.png, 02.png, 03.png'; a file with 100-999 pages will output '001.png, 002.png, 003.png'. We need
    to use the same formatting for reading the images back in (and scanning them)

    :param number_of_pages: The total number of pages
    :return: A format string (e.g. '{:03}') to use for formatting these page numbers into filenames
    """
    formatted_number_length = int(math.log10(number_of_pages)) + 1
    return "{:0" + str(formatted_number_length) + "}"