def convert_price(price, use_float):
    """
    Converts price to an integer representing a mil.
    1 mil = 0.0001
    Smallest representable size is 0.0001
    """
    if use_float:
        # Use floats to approximate prices instead of exact representation
        return int(float(price) * float(10000))
    else:
        # Exact representation
        idx = price.index('.')
        concat = "%s%s" % (price[0:idx], price[idx+1:].ljust(4,'0')[0:4])
        return int(concat)
        #from decimal import Decimal
        #return int(Decimal(price) * Decimal(10000))