This commit is contained in:
GukSang.Jin
2026-05-28 12:33:58 +08:00
parent 047f0f1029
commit a5cdb1d9d5

View File

@@ -25,7 +25,7 @@ public sealed class RealtimeDataRowViewModel
MlrText = Format(record.MassLossRate); MlrText = Format(record.MassLossRate);
HeatReleaseText = Format(record.HeatReleaseRateKw); HeatReleaseText = Format(record.HeatReleaseRateKw);
EhcText = Format(record.EffectiveHeatOfCombustion); EhcText = Format(record.EffectiveHeatOfCombustion);
MassLossText = Format(record.MassLoss); MassLossText = FormatAbsolute(record.MassLoss);
} }
public string TimeText { get; init; } = string.Empty; public string TimeText { get; init; } = string.Empty;
@@ -62,4 +62,9 @@ public sealed class RealtimeDataRowViewModel
{ {
return double.IsFinite(value) ? value.ToString(format, CultureInfo.InvariantCulture) : string.Empty; return double.IsFinite(value) ? value.ToString(format, CultureInfo.InvariantCulture) : string.Empty;
} }
private static string FormatAbsolute(double value, string format = "0.00")
{
return double.IsFinite(value) ? Math.Abs(value).ToString(format, CultureInfo.InvariantCulture) : string.Empty;
}
} }