Ensure fromRUB() never returns value below 1

This commit is contained in:
Dev 2024-03-18 16:25:04 +00:00
parent b5565f3901
commit dfdf1d22db

View File

@ -203,7 +203,7 @@ export class HandbookHelper
// Get price of currency from handbook // Get price of currency from handbook
const price = this.getTemplatePrice(currencyTypeTo); 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 public getCategoryById(handbookId: string): Category