Revision 987
Added by Aaron Marcuse-Kubitza almost 13 years ago
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
util.py: Added int2str()