TIM SDK
TIM API C
amount_dcc.h File Reference

Description

DCC Amount.

Object type amount_dcc.

Functions

ta_e_result_code_t ta_amount_dcc_get_value (ta_object_t amount, int64_t *value)
 DCC Amount in minor units. More...
 
ta_e_result_code_t ta_amount_dcc_get_decimal_value (ta_object_t amount, double *value)
 DCC Amount in major units as double precision floating point value. More...
 
ta_e_result_code_t ta_amount_dcc_get_currency (ta_object_t amount, ta_e_currency_t *currency)
 DCC Currency. More...
 
ta_e_result_code_t ta_amount_dcc_get_exponent (ta_object_t amount, int *exponent)
 DCC Exponent. More...
 
ta_e_result_code_t ta_amount_dcc_get_rate (ta_object_t amount, int *rate)
 DCC Rate in minor units. More...
 
ta_e_result_code_t ta_amount_dcc_get_rate_exponent (ta_object_t amount, int *exponent)
 DCC rate exponent. More...
 
ta_e_result_code_t ta_amount_dcc_get_rate_decimal (ta_object_t amount, double *rate)
 DCC Rate in major units as double precision floating point value. More...
 
ta_e_result_code_t ta_amount_dcc_get_markup (ta_object_t amount, int *markup)
 DCC Markup in minor units. More...
 
ta_e_result_code_t ta_amount_dcc_get_markup_exponent (ta_object_t amount, int *exponent)
 DCC Markup exponent. More...
 
ta_e_result_code_t ta_amount_dcc_get_markup_decimal (ta_object_t amount, double *markup)
 DCC Markup in major units as double precision floating point value. More...
 

Function Documentation

◆ ta_amount_dcc_get_currency()

ta_e_result_code_t ta_amount_dcc_get_currency ( ta_object_t  amount,
ta_e_currency_t currency 
)

DCC Currency.

Parameters
[in]amountObject instance of type amount_dcc.
[out]currencyPointer to variable to write currency to.
Return values
ta_c_rc_okValue written to currency.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentcurrency is null-pointer.

◆ ta_amount_dcc_get_decimal_value()

ta_e_result_code_t ta_amount_dcc_get_decimal_value ( ta_object_t  amount,
double *  value 
)

DCC Amount in major units as double precision floating point value.

Note
Double precision floating point values can not provide the same level of numerical accuracy as int64_t. It is recommended to use the integer based methods.
Parameters
[in]amountObject instance of type amount_dcc.
[out]valuePointer to variable to write value to.
Return values
ta_c_rc_okValue written to value.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentvalue is null-pointer.

◆ ta_amount_dcc_get_exponent()

ta_e_result_code_t ta_amount_dcc_get_exponent ( ta_object_t  amount,
int *  exponent 
)

DCC Exponent.

Parameters
[in]amountObject instance of type amount_dcc.
[out]exponentPointer to variable to write exponent to.
Return values
ta_c_rc_okValue written to exponent.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentexponent is null-pointer.

◆ ta_amount_dcc_get_markup()

ta_e_result_code_t ta_amount_dcc_get_markup ( ta_object_t  amount,
int *  markup 
)

DCC Markup in minor units.

Parameters
[in]amountObject instance of type amount_dcc.
[out]markupPointer to variable to write markup to.
Return values
ta_c_rc_okValue written to markup.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentmarkup is null-pointer.

◆ ta_amount_dcc_get_markup_decimal()

ta_e_result_code_t ta_amount_dcc_get_markup_decimal ( ta_object_t  amount,
double *  markup 
)

DCC Markup in major units as double precision floating point value.

DCC markup exponent has been applied already to the value. Returned value can be used as-is without the need to adjust for the exponent.

Note
Double precision floating point values can not provide the same level of numerical accuracy as int64_t. It is recommended to use the integer based methods.
Parameters
[in]amountObject instance of type amount_dcc.
[out]markupPointer to variable to write markup to.
Return values
ta_c_rc_okValue written to markup.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentmarkup is null-pointer.

◆ ta_amount_dcc_get_markup_exponent()

ta_e_result_code_t ta_amount_dcc_get_markup_exponent ( ta_object_t  amount,
int *  exponent 
)

DCC Markup exponent.

Parameters
[in]amountObject instance of type amount_dcc.
[out]exponentPointer to variable to write markup exponent to.
Return values
ta_c_rc_okValue written to exponent.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentexponent is null-pointer.

◆ ta_amount_dcc_get_rate()

ta_e_result_code_t ta_amount_dcc_get_rate ( ta_object_t  amount,
int *  rate 
)

DCC Rate in minor units.

Parameters
[in]amountObject instance of type amount_dcc.
[out]ratePointer to variable to write rate to.
Return values
ta_c_rc_okValue written to rate.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentrate is null-pointer.

◆ ta_amount_dcc_get_rate_decimal()

ta_e_result_code_t ta_amount_dcc_get_rate_decimal ( ta_object_t  amount,
double *  rate 
)

DCC Rate in major units as double precision floating point value.

DCC rate exponent has been applied already to the value. Returned value can be used as-is without the need to adjust for the exponent.

Note
Double precision floating point values can not provide the same level of numerical accuracy as int64_t. It is recommended to use the integer based methods.
Parameters
[in]amountObject instance of type amount_dcc.
[out]ratePointer to variable to write rate to.
Return values
ta_c_rc_okValue written to rate.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentrate is null-pointer.

◆ ta_amount_dcc_get_rate_exponent()

ta_e_result_code_t ta_amount_dcc_get_rate_exponent ( ta_object_t  amount,
int *  exponent 
)

DCC rate exponent.

Parameters
[in]amountObject instance of type amount_dcc.
[out]exponentPointer to variable to write rate exponent to.
Return values
ta_c_rc_okValue written to exponent.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentexponent is null-pointer.

◆ ta_amount_dcc_get_value()

ta_e_result_code_t ta_amount_dcc_get_value ( ta_object_t  amount,
int64_t *  value 
)

DCC Amount in minor units.

Parameters
[in]amountObject instance of type amount_dcc.
[out]valuePointer to variable to write value to. Use ta_amount_dcc_get_exponent to get the used exponent. This can be a different exponent than the one defined by the used currency.
Return values
ta_c_rc_okValue written to value.
ta_c_rc_invalid_argumentamount is ta_invalid_object.
ta_c_rc_invalid_argumentamount is not of type amount_dcc.
ta_c_rc_invalid_argumentvalue is null-pointer.