Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Friendly Number by panaro32
def friendly_number(n,base=1000,decimals=0,powers=['','k','M','G','T','P','E','Z','Y'],suffix=''):
p,c = ([(0,0)]+[(x,n/base**x) for x in range(len(powers)) if base**x<=abs(n)])[-1]
return (decimals and '%.*f'%(decimals,c) or str(int(c)))+powers[p]+suffix
May 18, 2014
Comments: