endurox.Bfloatev

endurox.Bfloatev(fbfr: object, expression: str) float

Evaluate Boolean expression as float number on given UBF buffer.

Bfloatev example
    import endurox

    print(endurox.Bfloatev({"data":{"T_STRING_FLD":"99", "T_SHORT_FLD":2}}, "T_STRING_FLD-T_SHORT_FLD"))
    # will print 97.0

For more details see Bfloatev(3) C API call.

Raises:

UbfException

Following error codes may be present:
BALIGNERR - Corrupted UBF buffer.
BNOTFLD - Invalid ATMI buffer format, not UBF.
BEINVAL - Invalid arguments passed.
BBADNAME - Field not found in FD files or UBFDB.
BSYNTAX - Bad boolean expression syntax
BFTOPEN - Unable to open field tables.
BEBADOP - Operation not supported on given field types.

Parameters:
  • fbfr (dict) – ATMI buffer on which to test the expression

  • expression (str) – Boolean expression

Returns:

ret – Returns result as float.

Return type:

float