mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Add the concept of RateDivisibility
This commit is contained in:
@@ -875,13 +875,7 @@ namespace BTCPayServer.Controllers
|
||||
return extension?.Image ?? "";
|
||||
}
|
||||
|
||||
var cd = this._CurrencyNameTable.GetCurrencyData(prompt.Currency, false);
|
||||
// Show the "Common divisibility" rather than the payment method disibility.
|
||||
// For example, BTC has commonly 8 digits, but on lightning it has 11. In this case, pick 8.
|
||||
if (cd?.Divisibility is not int divisibility)
|
||||
divisibility = prompt.Divisibility;
|
||||
|
||||
string ShowMoney(decimal value) => MoneyExtensions.ShowMoney(value, divisibility);
|
||||
string ShowMoney(decimal value) => MoneyExtensions.ShowMoney(value, prompt.RateDivisibility ?? prompt.Divisibility);
|
||||
var model = new PaymentModel
|
||||
{
|
||||
Activated = prompt.Activated,
|
||||
|
||||
Reference in New Issue
Block a user