In GWT one can use java.math.BigDecimal
in the client code. How are these BigDecimals represented in the resulting JavaScript code after compilation? Is there some extra class for that or do they use a native JavaScript object?
BigDecimal
has no special treatment by the GWT Compiler. It's emulated with a bunch of fields, with a small optimization for the case where the value is in the java.lang.Double
(equivalent to a JS Number
) value range; but from the point of view of JS code, it's an opaque Object
.