# fix\(cost\): format credit balances without trailing \.0 or bogus separators \(\#181\) · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/c0e6c57027c49bb513ff685d61056bec668b89b1)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: c0e6c57027c49bb513ff685d61056bec668b89b1

Requested commit: c0e6c57027c49bb513ff685d61056bec668b89b1

Commit: c0e6c57027c49bb513ff685d61056bec668b89b1

Tree: 154acfa6bb9366bb8b05d152373b78d30a875718

Author: Simone

Committer: GitHub

## Message

```
fix(cost): format credit balances without trailing .0 or bogus separators (#181)

Credit balances that round up to a whole number at one fractional digit
kept the digit (99.95 printed as 100.0). The count formatter now drops
the fractional digit when the rounded figure is whole, using the
locale decimal mark, and magnitudes past 1e21 skip digit grouping
since Number.toFixed returns exponential notation there.

The main.qml helper delegates to the pure CostPresentation.formatCount
so the rounding stays covered by direct QtTests; the UI regression
check pins the delegation like the Guards.js precedent.
```

## Parents

- [ff07bd4866b6b8bb465347e5ea12e0083e671bc6](https://git.cafe/lucenx/codexbar-plasma/commit/ff07bd4866b6b8bb465347e5ea12e0083e671bc6?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/c0e6c57027c49bb513ff685d61056bec668b89b1?format=markdown)
