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

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

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

Visibility: public

Requested revision: 92730b0f0c32354839710c49ea4730664c992492

Requested commit: 92730b0f0c32354839710c49ea4730664c992492

Commit: 92730b0f0c32354839710c49ea4730664c992492

Tree: 154acfa6bb9366bb8b05d152373b78d30a875718

Author: Simone

Committer: Simone

## Message

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

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/92730b0f0c32354839710c49ea4730664c992492?format=markdown)
