def METHOD_NAME(s, space, nanRep=None, float_format=None):
    if isinstance(s, float):
        if float_format:
            formatted = float_format(s)
        else:
            formatted = "%#8.6F" % s
        return formatted.rjust(space)
    else:
        return ('%s' % s)[:space].rjust(space)