def format_value(value,number_format):
    "Convert number to string using a style string"

    style,sufix,scale = decode_format(number_format)
    fmt = "{0:" + style + "}" + sufix

    return fmt.format(scale * value)
def format_value ( value , number_format ) : style , sufix , scale = decode_format ( number_format ) fmt = "{0:" + style + "}" + sufix return fmt . format ( scale * value )
Convert number to string using a style string