diff --git a/Elwig/Helpers/Billing/Billing.cs b/Elwig/Helpers/Billing/Billing.cs index 0c4d561..72bceb2 100644 --- a/Elwig/Helpers/Billing/Billing.cs +++ b/Elwig/Helpers/Billing/Billing.cs @@ -10,7 +10,7 @@ namespace Elwig.Helpers.Billing { private readonly int AvNr; private readonly AppDbContext Context; private readonly Dictionary Attributes; - private readonly Dictionary Modifiers; + private readonly Dictionary Modifiers; private readonly Dictionary AreaComTypes; public Billing(int year, int avnr) { diff --git a/Elwig/Models/Modifier.cs b/Elwig/Models/Modifier.cs index 749e8a1..77c228f 100644 --- a/Elwig/Models/Modifier.cs +++ b/Elwig/Models/Modifier.cs @@ -23,16 +23,18 @@ namespace Elwig.Models { [NotMapped] public decimal? Abs { - get { - return AbsValue != null ? Season.DecFromDb(AbsValue.Value) : null; - } - set { - AbsValue = value != null ? Season.DecToDb(value.Value) : null; - } + get => AbsValue != null ? Season.DecFromDb(AbsValue.Value) : null; + set => AbsValue = value != null ? Season.DecToDb(value.Value) : null; } [Column("rel")] - public double? Rel { get; set; } + public double? RelValue { get; set; } + + [NotMapped] + public decimal? Rel { + get => (decimal?)RelValue; + set => RelValue = (double?)value; + } [Column("standard")] public bool IsStandard { get; set; } @@ -45,7 +47,7 @@ namespace Elwig.Models { public string ValueStr => (Abs != null) ? $"{Utils.GetSign(Abs.Value)}{Math.Abs(Abs.Value)}\u00a0{Season.Currency.Symbol}/kg" : - (Rel != null) ? $"{Utils.GetSign(Rel.Value)}{(Math.Abs(Rel.Value) < 0.1 ? "\u2007" : "")}{Math.Abs(Rel.Value):0.00##\u00a0%}" : + (Rel != null) ? $"{Utils.GetSign(Rel.Value)}{(Math.Abs(Rel.Value) < 0.1m ? "\u2007" : "")}{Math.Abs(Rel.Value):0.00##\u00a0%}" : ""; public override string ToString() {