예제 #1
0
파일: table.py 프로젝트: salihcaan/tia
        if fmtfct.parens and not result.endswith(')'):
            result += ' '
        return result

    return check_and_append


IntFormatter = pad_positive_wrapper(fmt.new_int_formatter(nan='-'))
FloatFormatter = pad_positive_wrapper(fmt.new_float_formatter(nan='-'))
PercentFormatter = pad_positive_wrapper(fmt.new_percent_formatter(nan='-'))
ThousandsFormatter = pad_positive_wrapper(fmt.new_thousands_formatter(nan='-'))
MillionsFormatter = pad_positive_wrapper(fmt.new_millions_formatter(nan='-'))
BillionsFormatter = pad_positive_wrapper(fmt.new_billions_formatter(nan='-'))
# Don't attempt to pad
DynamicNumberFormatter = fmt.DynamicNumberFormat(method='col',
                                                 nan='-',
                                                 pcts=1,
                                                 trunc_dot_zeros=1)

DollarCentsFormatter = pad_positive_wrapper(
    fmt.new_float_formatter(prefix='$', nan='-'))
DollarFormatter = pad_positive_wrapper(
    fmt.new_int_formatter(prefix='$', nan='-'))
ThousandDollarsFormatter = pad_positive_wrapper(
    fmt.new_thousands_formatter(prefix='$', nan='-'))
MillionDollarsFormatter = pad_positive_wrapper(
    fmt.new_millions_formatter(prefix='$', nan='-'))
BillionDollarsFormatter = pad_positive_wrapper(
    fmt.new_billions_formatter(prefix='$', nan='-'))
YmdFormatter = fmt.new_datetime_formatter('%Y%m%d', True)
Y_m_dFormatter = fmt.new_datetime_formatter('%Y-%m-%d', True)
mdYFormatter = fmt.new_datetime_formatter('%m/%d/%Y', True)
예제 #2
0
        if fmtfct.parens and not result.endswith(")"):
            result += " "
        return result

    return check_and_append


IntFormatter = pad_positive_wrapper(fmt.new_int_formatter(nan="-"))
FloatFormatter = pad_positive_wrapper(fmt.new_float_formatter(nan="-"))
PercentFormatter = pad_positive_wrapper(fmt.new_percent_formatter(nan="-"))
ThousandsFormatter = pad_positive_wrapper(fmt.new_thousands_formatter(nan="-"))
MillionsFormatter = pad_positive_wrapper(fmt.new_millions_formatter(nan="-"))
BillionsFormatter = pad_positive_wrapper(fmt.new_billions_formatter(nan="-"))
# Don't attempt to pad
DynamicNumberFormatter = fmt.DynamicNumberFormat(method="col",
                                                 nan="-",
                                                 pcts=1,
                                                 trunc_dot_zeros=1)

DollarCentsFormatter = pad_positive_wrapper(
    fmt.new_float_formatter(prefix="$", nan="-"))
DollarFormatter = pad_positive_wrapper(
    fmt.new_int_formatter(prefix="$", nan="-"))
ThousandDollarsFormatter = pad_positive_wrapper(
    fmt.new_thousands_formatter(prefix="$", nan="-"))
MillionDollarsFormatter = pad_positive_wrapper(
    fmt.new_millions_formatter(prefix="$", nan="-"))
BillionDollarsFormatter = pad_positive_wrapper(
    fmt.new_billions_formatter(prefix="$", nan="-"))
YmdFormatter = fmt.new_datetime_formatter("%Y%m%d", True)
Y_m_dFormatter = fmt.new_datetime_formatter("%Y-%m-%d", True)
mdYFormatter = fmt.new_datetime_formatter("%m/%d/%Y", True)