Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbCurrencyDiv

Divide a currency value by another currency value. pResult = left / right.

Declaration

CTDBRET ctdbCurrencyDiv(CTCURRENCY left, CTCURRENCY right,

pCTCURRENCY pResult)

Description

ctdbCurrencyDiv() divides the left currency value by the right currency value (e.g., pResult = left / right). Do not make regular division with CTCURRENCY values. Use regular division between a CTCURRENCY value and a numeric value (int, COUNT, FLOAT, etc.).

  • left [in] the value to be divided (divisor).
  • right [in] the value to divide (dividend).
  • pResult [out] the result of the Div operation.

Returns

ctdbCurrencyDiv() returns CTDBRET_OK on success, or FairCom DB API error on failure.

The possible errors associated with ctdbCurrencyDiv() are:

  • CTDBRET_NULARG (4007): Null argument not valid in any operand
  • CTDBRET_DIVBYZERO (4040): Division by zero error

See also

ctdbCurrencyAdd(), ctdbCurrencySub(), ctdbCurrencyMul()

TOCIndex