# fix\(cost\): avoid negative-zero credit balances \(\#217\) · lucenx/codexbar-plasma

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

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

Visibility: public

Requested revision: e9f434ce6a710fd23d00f1546c8d6243f964a622

Requested commit: e9f434ce6a710fd23d00f1546c8d6243f964a622

Commit: e9f434ce6a710fd23d00f1546c8d6243f964a622

Tree: 8ded4e33894fa2c731105ae9be02f7741906f735

Author: Simone

Committer: GitHub

## Message

```
fix(cost): avoid negative-zero credit balances (#217)

A credit balance between -0.05 and 0 rounds to zero at the displayed
precision, but formatCount() formatted the magnitude and then prepended
the sign unconditionally, producing the string "-0". Drop the sign when
the rounded figure is zero.

Add a behavioural regression test covering the tiny negative case and
the negative controls that must keep their sign, and record the fix under
Unreleased.
```

## Parents

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

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