From dfdf1d22db2ea5235c341b6b9c7681f449eeb344 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 18 Mar 2024 16:25:04 +0000 Subject: [PATCH] Ensure `fromRUB()` never returns value below 1 --- project/src/helpers/HandbookHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/helpers/HandbookHelper.ts b/project/src/helpers/HandbookHelper.ts index c91ee3f4..54a016bf 100644 --- a/project/src/helpers/HandbookHelper.ts +++ b/project/src/helpers/HandbookHelper.ts @@ -203,7 +203,7 @@ export class HandbookHelper // Get price of currency from handbook const price = this.getTemplatePrice(currencyTypeTo); - return price ? Math.round(roubleCurrencyCount / price) : 0; + return price ? Math.max(1, Math.round(roubleCurrencyCount / price)) : 0; } public getCategoryById(handbookId: string): Category