diff --git a/Libraries/Core/Helpers/HandbookHelper.cs b/Libraries/Core/Helpers/HandbookHelper.cs index 8270305e..5ba7e9e9 100644 --- a/Libraries/Core/Helpers/HandbookHelper.cs +++ b/Libraries/Core/Helpers/HandbookHelper.cs @@ -169,12 +169,18 @@ public class HandbookHelper( /// currency count in desired type public double FromRUB(double roubleCurrencyCount, string currencyTypeTo) { - throw new NotImplementedException(); + if (currencyTypeTo == Money.ROUBLES) { + return roubleCurrencyCount; + } + + // Get price of currency from handbook + var price = GetTemplatePrice(currencyTypeTo); + return price is not null ? Math.Max(1, Math.Round((double)(roubleCurrencyCount / price))) : 0; } public HandbookCategory GetCategoryById(string handbookId) { - throw new NotImplementedException(); + return _databaseService.GetHandbook().Categories.FirstOrDefault(category => category.Id == handbookId); } }