mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Can inject currency data in CurrencyNameTable (#6276)
This commit is contained in:
@@ -875,9 +875,10 @@ namespace BTCPayServer.Controllers
|
||||
return extension?.Image ?? "";
|
||||
}
|
||||
|
||||
// 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 (this._CurrencyNameTable.GetCurrencyData(prompt.Currency, false)?.Divisibility is not int divisibility)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user