mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
* Reporting: Improve rounding and display * Fix test * Refactor --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
25 lines
636 B
C#
25 lines
636 B
C#
using BTCPayServer.JsonConverters;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace BTCPayServer.Services.Reporting
|
|
{
|
|
public class FormattedAmount
|
|
{
|
|
public FormattedAmount(decimal value, int divisibility)
|
|
{
|
|
Value = value;
|
|
Divisibility = divisibility;
|
|
}
|
|
[JsonProperty("v")]
|
|
[JsonConverter(typeof(NumericStringJsonConverter))]
|
|
public decimal Value { get; set; }
|
|
[JsonProperty("d")]
|
|
public int Divisibility { get; set; }
|
|
|
|
public JObject ToJObject()
|
|
{
|
|
return JObject.FromObject(this);
|
|
}
|
|
}
|
|
}
|