Open stevenengland opened 3 years ago
Might be most feasable if I could switch to C#9 where generic nullable types are allowed. That way I could change IMemoryFieldValue
// If I ever switch to decimal I should try to introduce nullable types which is fine in C#9
this.MemoryFields.Get<double>(MemoryFieldNames.RepaymentRateNumber).Value =
isFiniteNumber ? calculationResult : double.NaN;
Should become
// If I ever switch to decimal I should try to introduce nullable types which is fine in C#9
this.MemoryFields.Get<decimal>(MemoryFieldNames.RepaymentRateNumber).Value =
isFiniteNumber ? calculationResult : null;
Which can be handled nicely by the number to string formatter for the representation in the ui.
The internal calculations use double values rather than decimal ones. At the moment there is no need for decimals. But as the calculator evolves maybe decimals will be important.