Exemplo n.º 1
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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)