From 45dadf4e3cb8a9663a19fa8a0a849ea4299a9a1f Mon Sep 17 00:00:00 2001 From: posthog-watcher-action Date: Tue, 23 Jun 2026 18:13:41 +0000 Subject: [PATCH 1/2] Fix #28: Shipping endpoint truncates cents --- src/business.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/business.js b/src/business.js index a8f0cd0..d6a1a0c 100644 --- a/src/business.js +++ b/src/business.js @@ -31,8 +31,7 @@ function estimateShipping(weightKg, expedited = false) { estimate *= 1.5; } - // BUG: rounds down and loses cents. - return Math.floor(estimate); + return roundToCents(estimate); } function isValidEmail(email) { From 9577c6f20dc9b82fd4198bbb3eb91958d6730aa7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:01:54 +0000 Subject: [PATCH 2/2] Fix #28: Shipping endpoint truncates cents --- test/business.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/business.test.js b/test/business.test.js index e84f4fa..53de00c 100644 --- a/test/business.test.js +++ b/test/business.test.js @@ -30,6 +30,7 @@ test('username normalization trims, lowercases, and collapses whitespace', () => }); test('shipping estimate preserves cents', () => { + assert.notEqual(estimateShipping(2.2), 7); assert.equal(estimateShipping(2.2), 7.75); });