currencygithub.com/castedo/isomon

Name

isomon::data::set_num_minors — Set number of minors per major unit for currency.

Synopsis

// In header: </home/castedo/src/isomon/currency_data.h>


bool set_num_minors(int16_t isonum, int16_t num_minors, int8_t num_digits);

Description

Not thread-safe. Typically this would only be called during program initialization. At most 16 distinct numbers of minors can be used across all currencies. If a currency is set to use 17th possible number of minors, this function will return false and fail.

Parameters:

isonum

An ISO numeric code, real or fake, in the range [0, ISOMON_ISONUM_COUNT). ISOMON_ISONUM_COUNT is probably 1024.

num_minors

Number of minor units per major unit. Use 1 if the major unit is the smallest unit of money (i.e major = minor). Use 0 if there is no smallest unit or it is not applicable.