'Try to format units using a formatter.'

def __format__(self, format_spec):

    try:
        return self.to_string(format=format_spec)
    except ValueError:
        return format(six.text_type(self), format_spec)
