# fix\(costs\): preserve finite per-million rates on overflow \(\#585\) · lucenx/codexbar-plasma

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

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

Visibility: public

Requested revision: 4b25224e103d2f67b7d8f939a63abd2fb0ec31fd

Requested commit: 4b25224e103d2f67b7d8f939a63abd2fb0ec31fd

Commit: 4b25224e103d2f67b7d8f939a63abd2fb0ec31fd

Tree: 581f584ee66561b41399c095b92312a8e79495b2

Author: Simone

Committer: GitHub

## Message

```
fix(costs): preserve finite per-million rates on overflow (#585)

Scaling the cost by one million could overflow before division by the token total. Retry with a scaled denominator and omit unrepresentable final rates, preserving ordinary rounding.

Add direct and executed label regressions. Documentation: update usage, cost-history rules and Unreleased; TODO parity items are unaffected.
```

## Parents

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

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