- 16 Jul 2021
- 1 Minute To Read
- Print
- DarkLight
- PDF
Truncating and rounding interest
- Updated On 16 Jul 2021
- 1 Minute To Read
- Print
- DarkLight
- PDF
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).
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:
In the Deposit's API responses, interest accruals are not truncated, they are displayed using 10 decimals.