Truncating and rounding interest
  • 16 Jul 2021
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Truncating and rounding interest

  • Dark
    Light
  • PDF

Article Summary

It's uncommon to use more than two decimals in daily life. In order to show usable values we truncate and round interest to display a whole number or a number with fewer decimals.

Number of decimals used for interest calculation

We use 20 decimals for the calculation of interest accruals.

Number of decimals stored in the database

When storing interest accruals in the database, we truncate the amount to 10 decimals.

Number of decimals displayed in Journal Entries

For Journal Entries (JE) tables, we calculate the interest accrual aggregate per deposit product, which is the aggregation of all interest accruals taken from all the deposit accounts created under the respective deposit product. Therefore we sum the related interest accrual amounts that contain 10 decimals and we round the end result to the number of decimals requested by the base currency of the tenant (please see below).

JE interest accrual rounded to two decimals

Number of decimals used for amounts

The interest amount is rounded to the number of decimals preset on the base currency (zero for Japanese Yen (JPY), two for American Dollar (USD) and European Euro (EUR), three for Jordanian Dinar (JOD), eight for Bitcoin, and so on).

The currencies available and their decimal number are available under Administration > Financial Setup > Currency > Add Currency:

The add currency dialogue emphasizing the number of decimals for the selected currency, in this case, Bitcoin 8

Please Note

In the Deposit's API responses, interest accruals are not truncated, they are displayed using 10 decimals.


Was this article helpful?