def __call__(self,otherdim, fmt=None):
        '''return value when expressed in otherdim dimensions'''
        o=Q(1,otherdim)
        if self.dims==o.dims:
            if fmt==None:
                return self.value/o.value
            else:
                return ''.join([fmt % (self.value/o.value),' [',
                        otherdim,']'])               
        else:
            raise DimensionsError, 'Units not consistent'
return value when expressed in otherdim dimensions
recipes/Python/577333_Numerical_type_units/recipe-577333.py