Package io.deephaven.web.client.api
Class BigDecimalWrapper
java.lang.Object
io.deephaven.web.client.api.BigDecimalWrapper
Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleasNumber()Returns the wrapped value as a number.booleanCompares this wrapper to another object.inthashCode()Returns a hash code based on the wrapped value.static BigDecimalWrapperCreates a wrapper from a decimal string.toString()Returns the string representation of the wrappedBigDecimal.valueOf()Returns the string representation of this value.
-
Constructor Details
-
BigDecimalWrapper
-
-
Method Details
-
ofString
Creates a wrapper from a decimal string. Strings may optionally start with+/-, must have a decimal value, and may end withe/Efollowed by an exponent.- Parameters:
value- A string representation of a decimal number.- Returns:
- A wrapper for the parsed value.
-
getWrapped
-
asNumber
public double asNumber()Returns the wrapped value as a number.- Returns:
- The
BigDecimalvalue converted to a JS Number.
-
valueOf
Returns the string representation of this value.Provided to match JavaScript's
valueOfconvention.- Returns:
- The string form of this value.
-
toString
Returns the string representation of the wrappedBigDecimal. -
equals
Compares this wrapper to another object.- Overrides:
equalsin classObject- Parameters:
o- The object to compare.- Returns:
trueifois aBigDecimalWrapperwith an equal wrapped value.
-
hashCode
public int hashCode()Returns a hash code based on the wrapped value.
-