import re
import math


def number_to_block(number, block_number=0):
    """
    Given an address number, normalizes it to the block number.
    >>> number_to_block(1)
    '0'
    >>> number_to_block(10)
    '0'
    >>> number_to_block(100)
    '100'
    >>> number_to_block(5)
    '0'
    >>> number_to_block(53)
    '0'
    >>> number_to_block(153)
    '100'
    >>> number_to_block(1000)
    '1000'
    >>> number_to_block(1030)
    '1000'
    >>> number_to_block(1359)
    '1300'
    >>> number_to_block(13593)
    '13500'
    >>> number_to_block('01')
    '0'
    >>> number_to_block('00')
    '0'
    >>> number_to_block('foo')
    'foo'
    >>> number_to_block('3xx')
    '300'
    >>> number_to_block('3XX')
    '300'
    >>> number_to_block('3pp')
    '3pp'
    >>> number_to_block('XX')
    '0'
    >>> number_to_block('X')
    'X'
    block_number lets you customize the "XX" of "3XX block".
    >>> number_to_block(234, 99)
    '299'
    >>> number_to_block(12345, 99)
    '12399'
    """
    number = re.sub('(?i)xx', '00', str(number))
    try:
        number = int(number)
    except (TypeError, ValueError):
        return number
    return str(int(math.floor(number / 100.0)) * 100 + block_number)