You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
just in case someone experiences issues with decimal numbers while using AsserThat.
I have found an interessting behaviour of the used parser when using mixed type values in a mathematical formula.
When mixing int/decimal? the calculation returns a wrong result: Parser.Parse<double>(validationContextType, "MyValue * 4300").Invoke(new MyClass(){ MyValue = 1.2 }) == 4300 // should be 5160
Replacing the int by a number with a decimal place, the parser works as expected. Parser.Parse<double>(validationContextType, "MyValue * 4300.0").Invoke(new MyClass(){ MyValue = 1.2 }) == 5160
For constants just add ".0" [AssertThat("Value1<= Value2 * 4380.0",..)]
I hope this helps someone.
The text was updated successfully, but these errors were encountered:
Hi,
just in case someone experiences issues with decimal numbers while using AsserThat.
I have found an interessting behaviour of the used parser when using mixed type values in a mathematical formula.
When mixing
int
/decimal?
the calculation returns a wrong result:Parser.Parse<double>(validationContextType, "MyValue * 4300").Invoke(new MyClass(){ MyValue = 1.2 }) == 4300 // should be 5160
Replacing the int by a number with a decimal place, the parser works as expected.
Parser.Parse<double>(validationContextType, "MyValue * 4300.0").Invoke(new MyClass(){ MyValue = 1.2 }) == 5160
For constants just add ".0"
[AssertThat("Value1<= Value2 * 4380.0",..)]
I hope this helps someone.
The text was updated successfully, but these errors were encountered: