Modifier migration

This commit is contained in:
2023-08-17 23:06:40 +02:00
parent 58235e3b02
commit 0d609c1013
5 changed files with 12 additions and 9 deletions

View File

@ -11,6 +11,9 @@ namespace Elwig.Models {
[Column("modid")]
public string ModId { get; set; }
[Column("ordering")]
public int Ordering { get; set; }
[Column("name")]
public string Name { get; set; }
@ -39,9 +42,9 @@ namespace Elwig.Models {
[ForeignKey("Year")]
public virtual Season Season { get; private set; }
public string ValueStr => (Abs != null) ?
$"{(Abs < 0 ? " -" : "+")}{Math.Abs(Abs.Value)} {Season.Currency.Symbol}/kg" :
$"{(Rel < 0 ? " -" : "+")}{Math.Abs(Rel.Value):P2}";
public string ValueStr =>
(Abs != null) ? $"{(Abs.Value < 0 ? "\u00a0-" : "+")}{Math.Abs(Abs.Value)}\u00a0{Season.Currency.Symbol}/kg" :
(Rel != null) ? $"{(Rel.Value < 0 ? "\u00a0-" : "+")}{(Math.Abs(Rel.Value) < 0.1 ? "\u2007" : "")}{Math.Abs(Rel.Value):0.00##\u00a0%}" : "";
public override string ToString() {
return Name;