# Rounding issue?

**URL:** https://discuss.tryton.org/t/rounding-issue/5324
**Category:** User
**Tags:** accounting
**Created:** [June 4, 2022, 11:48am UTC](https://discuss.tryton.org/t/rounding-issue/5324 "2022-06-04T11:48:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [June 4, 2022, 11:48am UTC](https://discuss.tryton.org/t/rounding-issue/5324/1 "2022-06-04T11:48:20Z")

</div>

deleted - wrong place

---

<div class="post-metadata">

### Author: ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)
#### Post date: [June 5, 2022, 4:21pm UTC](https://discuss.tryton.org/t/rounding-issue/5324/2 "2022-06-05T16:21:36Z")

</div>

What would be correct in your mind ?  
making the operations manually, I find the same but for the second example which is completely wrong. Is it the problem ?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 6, 2022, 7:49am UTC](https://discuss.tryton.org/t/rounding-issue/5324/3 "2022-06-06T07:49:25Z")

</div>

You are free to configure the number of decimal for the unit price: [Configuration — Tryton module with products](https://docs.tryton.org/projects/modules-product/en/latest/configuration.html#price-decimal)  
And you are free to choose between rounding “Per Document” or “Per Line” in the accounting configuration.

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [June 6, 2022, 12:16pm UTC](https://discuss.tryton.org/t/rounding-issue/5324/4 "2022-06-06T12:16:14Z")

</div>

Thank you all very much for your attention. As mostly, I have to recognize, I was not precise enough. Let’s try again, take my 1st example.

Here come results from calc, without any rounding:

| desc | pieces | item price | line total |
| --- | --- | --- | --- |
| [SKR7224] Skaterrad 72x24 | 2 | 3,3613 | 6,7226 |
| [RTsb24] Sondermaß Breite \<24mm | 1 | 4,2017 | 4,2017 |
| [KU6362RS] Kugellager 636 2RS | 4 | 0,8403 | 3,3612 |
| [VB] Versand - Brief | 1 | 2,521 | 2,521 |
| | | Subtot | 16,8065 |
| | | VAT | 3,193235 |
| | | Total | |
| 19,999735 | | | |

So the total sums up to 19,999735 - which IMHO should round up to 20,00 - but it does not.

With switiching to “round per line” in `accounting settings`, the rounding then happens nicely in all my examples. Great. Unluckily there still are other issues:

These are ordinary moves, created from a template; input was a brutto value of 29,99, the formula should account 1/2 to the company:

## What tryton delivers:

| 3510 - Auslagen vom Gesellschafter | 0 | 15,00 |
| --- | --- | --- |
| 1406 - Abziehbare Vorsteuer 19 % | 2,39 | 0 |
| 6805 - Telefon | 12,60 | 0 |

So there is 1ct missing in the moves.

## What calc calcs (1st line = sum of 2nd and 3rd line):

| 3510 - Auslagen vom Gesellschafter | 0 | 15,00 |
| --- | --- | --- |
| 1406 - Abziehbare Vorsteuer 19 % | 2,39495798319328 | 0 |
| 6805 - Telefon | 12,6050420168067 | 0 |

## What calc calcs with 3 digits only (1st line = sum of 2nd and 3rd line):

| 3510 - Auslagen vom Gesellschafter | 0 | 15,00 |
| --- | --- | --- |
| 1406 - Abziehbare Vorsteuer 19 % | 2,395 | 0 |
| 6805 - Telefon | 12,605 | 0 |

So even 3 digits should be good enough in this example; I’ve got 4. Nevertheless, the rounding result is not what I’d expect; I think, 12,605 should round to 12,61, and not to 12,60.

Tell me if I’m riding on a wrong assumption.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 6, 2022, 12:28pm UTC](https://discuss.tryton.org/t/rounding-issue/5324/5 "2022-06-06T12:28:05Z")

</div>

> [@herrdeh](#):
>
> So the total sums up to 19,999735 - which IMHO should round up to 20,00 - but it does not.

This is a wrong assumption because the total amount with taxes is rounded separately because it appears in the accounting and the amount of each taxes also.

> [@herrdeh](#):
>
> These are ordinary moves, created from a template; input was a brutto value of 29,99, the formula should account 1/2 to the company

This is completely another topic.

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [June 13, 2022, 1:57pm UTC](https://discuss.tryton.org/t/rounding-issue/5324/6 "2022-06-13T13:57:51Z")

</div>

Alright. Thank you very much for your attention.

In the end I found that this issue is much more complicated that I initially thought; even with simple invoices. And worse - my examples are full of mistakes, shame on me.

So there is not a simple “catch it all” solution to this and not a mistake in tryton, and I guess, our crazy 19% VAT makes things worse.

Cheers,  
Wolf

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [July 13, 2022, 1:58pm UTC](https://discuss.tryton.org/t/rounding-issue/5324/7 "2022-07-13T13:58:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
