From 65693dd0b16af0baaf567bd8da79c70c3c21c966 Mon Sep 17 00:00:00 2001 From: inflop Date: Tue, 21 Apr 2026 23:06:58 +0200 Subject: [PATCH] An addition to the existing example for JPY and KWD currency calculations Updated README.md to include examples demonstrating VAT calculations using JPY and KWD as base currencies, enhancing clarity for users on multi-currency support. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index af0e8bd..596afe7 100644 --- a/README.md +++ b/README.md @@ -332,12 +332,16 @@ var engine = VatCalculationEngine.ForItems( cfg => cfg.NetUnitPrice(l => l.Price).Quantity(l => l.Qty).VatRate(l => l.Rate), baseCurrencyRounding: DefaultRounding.ZeroDecimalPlaces); +var jpyResult = engine.Calculate(lines, VatCalculationMethod.FromSumOfNetValues, eurJpy); + // EUR invoice, KWD base (3 decimal places — dinar is divided into 1000 fils): ExchangeRate eurKwd = ExchangeRate.Of(CurrencyCode.EUR, CurrencyCode.Of("KWD"), 0.3342m); var kwdEngine = VatCalculationEngine.ForItems( cfg => cfg.NetUnitPrice(l => l.Price).Quantity(l => l.Qty).VatRate(l => l.Rate), baseCurrencyRounding: new DefaultRounding(3)); + +var kwdResult = kwdEngine.Calculate(lines, VatCalculationMethod.FromSumOfNetValues, eurKwd); ``` Both parameters can be set independently — a CHF-denominated invoice settled in JPY would use `Rounding(new SwissRounding())` together with `BaseCurrencyRounding(DefaultRounding.ZeroDecimalPlaces)`.