def METHOD_NAME(value, fmt='g'):
    """Convert a number to a string in engineering notation.  E.g., 5e-9 -> 5n"""
    template = '{:' + fmt + '}{}'
    magnitude = abs(value)
    for exp, symbol in zip(range(9, -15 - 1, -3), 'GMk munpf'):
        factor = 10 ** exp
        if magnitude >= factor:
            return template.format(value / factor, symbol.strip())
    return template.format(value, '')