XRPL-Labs / Nop.Plugin.Payments.Xumm

Accept cryptocurrency payments on the XRP Ledger with Xumm.
MIT License
2 stars 1 forks source link

Decimal(18,4) rounding #3

Open DominiqueBlomsma opened 2 years ago

DominiqueBlomsma commented 2 years ago

NopCommerce decimal fields in the database are of type DECIMAL(18, 4) which means that product prices can have a maximum of 4 decimals. Since XRPL tokens can have up to 15 decimals we're unable to support all prices of all tokens.

There is also a fixed rounding on 2 decimals in nopCommerce besides the database limitation but we can implement a custom implementation of the PriceCalculationService and override decimal Round(decimal value, RoundingType roundingType).

The example shop uses Bitstamp USD as Primary Store Currency so this is not an issue at the moment but we might want to think of a generic solution to support a higher scale than 4 or at least 4 digits after the decimal separator.