Money
Index
Codec
Comparator
Constructor
Formatting
Numeric
Type
Other
Codec
__decode__
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
Comparator
!=
"Not equal to" operator
<
"Less than" operator
<=
"Less than or equal to" operator
==
"Equal to" operator
>
"Greater than" operator
>=
"Greater than or equal to" operator
clamp
Clamp value between minValue and maxValue
compare
Return an Ordering that represents comparison result
equals
Alias to '=='
max
"maximum" operator
min
"minimum" operator
Constructor
create
Construct a new model
Formatting
asString
Converts the given value to a String.
Numeric
*
Multiply operator
+
Addition operator
-
Subtract operator
isNegative
Returns true if the number is negative and false if the number is zero or positive.
isPositive
Returns true if the number is positive and false if the number is zero or negative.
isZero
Returns true if self is equal to the additive identity.
negate
Negates the given value.
Type
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
readonlytypeName
The factory type constant
asInstance
Try to convert anyValue to enum value or else returns
Option.None
hasInstance
Return
true
if the given value is an instance of the class.
Other
__call__
format
Returns a formatted representation of money
normalize
Normalizes a
BigDecimal
object to its simplest form. This means that the decimal part is reduced to its lowest terms.
parse
Parses a string argument and returns a Money If the
expression
is not valid, it returnsOption.None
Returns the decoded
input
,Result.Ok
orResult.Error()