money
Module money
lakshansivagnanasothy/money
Functions
areEqual
Returns true if values firstValue and secondValue are the equal, including the currency.
Return Type
- boolean - currency equal status
areSameCurrency
Returns true if values firstValue and r have a currency code and they are the same values.
Return Type
- boolean - currency type equal status
isNegative
Returns true if the specified money value is valid and is negative.
Parameters
- money Money - object to the validated
Return Type
- boolean - negative status
isPositive
Returns true if the specified money value is valid and is positive.
Parameters
- money Money - object to the validated
Return Type
- boolean - positive status
isValid
Checks if specified value has a valid units/nanos signs and ranges.
Parameters
- money Money - object to be validated
Return Type
- boolean - Validity
isZero
Checks if the money is zero.
Parameters
- money Money - object to be validated
Return Type
- boolean - zero status
multiplySlow
Slow multiplication operation done through adding the value to itself n-1 times.
Return Type
- Money - multiplied money object
negate
Negate returns the same amount with the sign negated.
Parameters
- money Money - object to be negated
Return Type
- Money - negated money object
renderMoney
Used to render Money
in a readable format.
Parameters
- money Money -
Money
value to be rendered
Return Type
- string - rendered value as a string
signMatches
Checks if the sign matches.
Parameters
- money Money - object to be validated
Return Type
- boolean - validity status
sum
Adds two Money
values.
Return Type
- Money - sum money object
validNanos
Checks if nanos are valid.
Parameters
- nanos int - nano input
Return Type
- boolean - validity status
Constants
Import
import lakshansivagnanasothy/money;
Metadata
Released date: over 1 year ago
Version: 0.2.0
Compatibility
Platform: any
Ballerina version: 2201.6.0
Pull count
Total: 21
Current verison: 13
Weekly downloads
Other versions
0.2.0
0.1.0Dependencies