Issue #33 resolved

format_data_size webhelper throws Exception on numbers <=0

Marcin Kuzminski
created an issue

When passing a 0 value to format_data_size webhelpers (and any others that use it) an "ValueError: math domain error" exception is thrown when executing m = int(math.log(size) / math.log(base)) I think it's a bug since few lines later we have a check {{{

!python

if m == 0:
    precision = '%.0f'

}}}

an very easy fix could be: {{{

!python

if size <= 0:
    m = 0
else:
    m = int(math.log(size) / math.log(base))

}}}