import math

def table_scale(biggest):
 
    if biggest < 1000:
        kmg = ''
        divisor = 1
    elif biggest < (1000*1000):
        kmg = 'K'
        divisor = 1000
    elif biggest < (1000*1000*1000):
        kmg = 'M'
        divisor = 1000*1000
    else:
        kmg = 'G'
        divisor = 1000*1000*1000
 
    return ( kmg, divisor )


def log_round_down(number):
    return 10.0**(int(math.log10(number)))


def log_axis_scale(data_points):
    rounded_down = log_round_down(sorted(data_points)[0])/10.0

    return [ rounded_down for x in data_points ]