def eng(x):
    """Return a string representing x in an engineer friendly notation"""
    a , b = powerise10(x)
    if -3<b<3: return "%.4g" % x
    a = a * 10**(b%3)
    b = b - b%3
    return "%.4g*10^%s" %(a,b)
Return a string representing x in an engineer friendly notation
recipes/Python/578238_Engineering_notation/recipe-578238.py