From b3deabbec026cc88478a1eaa9c2d7aa4722f4de3 Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Fri, 28 Feb 2020 03:57:13 +0200 Subject: [PATCH] fix: 1/1 text --- src/components/Prices.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Prices.ts b/src/components/Prices.ts index cdaf3edd..89e3e2d4 100644 --- a/src/components/Prices.ts +++ b/src/components/Prices.ts @@ -231,7 +231,8 @@ export const Prices = new PriceService() export function displayRounding (value: number, fraction: boolean = false): string { if (fraction && Math.abs(value) < 1) { if (value === 0) return '0' - return `1/${displayRounding(1 / value)}` + const r = `1/${displayRounding(1 / value)}` + return r === '1/1' ? '1' : r } if (Math.abs(value) < 10) { return Number(value.toFixed(1)).toString()