Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbCurrencySub

Subtract two currency values. pResult = left - right.

Declaration

CTDBRET ctdbCurrencySub(CTCURRENCY left, CTCURRENCY right,

pCTCURRENCY pResult)

Description

ctdbCurrencySub() subtracts two currency values. pResult = left - right. Do not make regular subtractions with CTCURRENCY values.

  • left [in] the first value, to be subtracted by right.
  • right [in] the second value, to subtract from left.
  • pResult [out] the result of the subtraction operation.

Returns

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

The possible errors associated with ctdbCurrencySub() are:

  • CTDBRET_NULARG (4007): Null argument not valid in any operand
  • CTDBRET_UNDERFLOW (4039): Operation caused underflow
  • CTDBRET_OVERFLOW (4038): Operation caused overflow

See also

ctdbCurrencyAdd(), ctdbCurrencyMul(), ctdbCurrencyDiv()

TOCIndex