# fix\(costs\): prevent overflow in history bar scaling \(\#573\) · lucenx/codexbar-plasma

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

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

Visibility: public

Requested revision: 4c9d154491029b5d710fa7287f72135c8795a6c3

Requested commit: 4c9d154491029b5d710fa7287f72135c8795a6c3

Commit: 4c9d154491029b5d710fa7287f72135c8795a6c3

Tree: 13caed9907a5cc059d7a0e09a552397ae42b5061

Author: Simone

Committer: GitHub

## Message

```
fix(costs): prevent overflow in history bar scaling (#573)

Divide by the selected maximum before converting the ratio to a percentage. Extreme finite daily amounts previously produced Infinity and rendered every affected bar at full width.

Add regression coverage through the daily normalizer for cost and token modes. Update the usage guide, cost-history reference and changelog; TODO parity entries are unaffected.
```

## Parents

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

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