Fix Modifier ValueStr

This commit is contained in:
2023-08-19 17:08:38 +02:00
parent 8f7d699b4e
commit 5093706a4a
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,4 @@
using Elwig.Helpers;
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations.Schema;
@ -43,8 +44,9 @@ namespace Elwig.Models {
public virtual Season Season { get; private set; }
public string ValueStr =>
(Abs != null) ? $"{(Abs.Value < 0 ? "\u00a0-" : "+")}{Math.Abs(Abs.Value)}\u00a0{Season.Currency.Symbol}/kg" :
(Rel != null) ? $"{(Math.Abs(Rel.Value) < 0.1 ? "\u2007" : "")}{(Rel.Value < 0 ? "\u00a0-" : "+")}{Math.Abs(Rel.Value):0.00##\u00a0%}" : "";
(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.00##\u00a0%}" :
"";
public override string ToString() {
return Name;