def roundf(x, precision=0):
    """Like round but works with large exponents in floats and high precision
    Based on http://stackoverflow.com/a/6539677/623735
    >>> 234042163./(2**24)
    13.94999998807...
    >>> roundf(234042163./(2**24), 5)
    13.95
    >>> roundf(1234.1234e-123, 5)
    1.2341e-120
    >>> roundf(1234.1234e-123, 3)
    1.23e-120
    >>> roundf(1234123.1234, 5)
    1234100.0
    >>> roundf(1234123.1234, 3)
    1230000.0
    """
    if precision > 0:
        return float("{:.{}e}".format(x, precision - 1))
    return x