@oh-my-pi/pi-utils 18.4.3 → 18.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.4.4] - 2026-09-29
6
+
7
+ ### Added
8
+
9
+ - Added `normalizePremiumRequests` (also still exported from `@oh-my-pi/pi-tui`).
10
+
5
11
  ## [18.4.3] - 2026-09-28
6
12
 
7
13
  ### Added
@@ -42,3 +42,5 @@ export declare function pluralize(label: string, count: number): string;
42
42
  * Format a ratio as a percentage.
43
43
  */
44
44
  export declare function formatPercent(ratio: number): string;
45
+ /** Round premium-request counters without losing legitimate fractional requests. */
46
+ export declare function normalizePremiumRequests(value: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-utils",
3
- "version": "18.4.3",
3
+ "version": "18.4.4",
4
4
  "description": "Shared utilities for pi packages",
5
5
  "keywords": [
6
6
  "cli",
@@ -57,7 +57,7 @@
57
57
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
58
58
  },
59
59
  "dependencies": {
60
- "@oh-my-pi/pi-natives": "18.4.3"
60
+ "@oh-my-pi/pi-natives": "18.4.4"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/bun": "^1.3.14"
package/src/format.ts CHANGED
@@ -127,3 +127,8 @@ export function pluralize(label: string, count: number): string {
127
127
  export function formatPercent(ratio: number): string {
128
128
  return `${(ratio * 100).toFixed(1)}%`;
129
129
  }
130
+
131
+ /** Round premium-request counters without losing legitimate fractional requests. */
132
+ export function normalizePremiumRequests(value: number): number {
133
+ return Math.round((value + Number.EPSILON) * 100) / 100;
134
+ }