(data, _as = None)
return expr % (data, numfmt, _as)
Format interval for output
Format interval for output
Format interval for output
def ival(data, _as = None):
    "Format interval for output"
    if not _as:
        _as = data.split('.')[-1]
    numfmt = 'FM9999999'
    expr = "coalesce(to_char(extract(epoch from %s), '%s') || 's', 'NULL') as %s"
    return expr % (data, numfmt, _as)
def ival ( data , _as = None ) : if not _as : _as = data . split ( '.' ) [ - 1 ] numfmt = 'FM9999999' expr = "coalesce(to_char(extract(epoch from %s), '%s') || 's', 'NULL') as %s" return expr % ( data , numfmt , _as )