Project

General

Profile

« Previous | Next » 

Revision 987

util.py: Added int2str()

View differences:

lib/util.py
37 37
def format_str(format, val):
38 38
    return locale.format_string(format, val, grouping=True)
39 39

  
40
def int2str(val): return format_str('%d', val)
41

  
40 42
def to_percent(val, sig_figs=2):
41 43
    if val >= 1: sig_figs += 1
42 44
    return format_str('%#.'+str(sig_figs)+'g', val*100)+'%'

Also available in: Unified diff