def _convert_value_from(self, unit, value):
        if not isinstance(value, float):
            value = float(value)

        if isinstance(unit, sympy.Expr):
            _, result = solve_linear(unit, value)
            return result
        return unit * value
Exemple #2
0
    def _convert_value_from(self, unit, value):
        if not isinstance(value, float):
            value = float(value)

        if isinstance(unit, sympy.Expr):
            _, result = solve_linear(unit, value)
            return result
        return unit * value
Exemple #3
0
 def _convert_value_from(self, unit, value):
     if isinstance(unit, sympy.Expr):
         _, result = solve_linear(unit, sympy.Float(str(value)))
         return Decimal(str(result))
     return Decimal(unit) * Decimal(value)
Exemple #4
0
 def _convert_value_from(self, unit, value):
     if isinstance(unit, sympy.Expr):
         _, result = solve_linear(unit, sympy.Float(str(value)))
         return Decimal(str(result))
     return Decimal(unit) * Decimal(value)