I've got the following expression in Android Java:
myVar + " == 0 ? " + BigDecimal.ZERO.equals(myVar)
which outputs the following:
0.0000 == 0 ? false
Where myVar
is declared as:
public BigDecimal myVar;
And assigned successfully with Gson
, from served JSON data (I inspected this to verify the JSON was good).
Why does 0.0000
as a BigDecimal
not equal BigDecimal.ZERO
?