public class Price
extends java.lang.Object
Constructor and Description |
---|
Price(int n,
int d)
Create a new price.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
static Price |
fromString(java.lang.String price)
Approximates
price to a fraction. |
int |
getDenominator()
Returns denominator
|
int |
getNumerator()
Returns numerator.
|
io.digitalbits.sdk.xdr.Price |
toXdr()
Generates Price XDR object.
|
public Price(int n, int d)
n
- numeratord
- denominatorpublic int getNumerator()
public int getDenominator()
public static Price fromString(java.lang.String price)
price
to a fraction.
Please remember that this function can give unexpected results for values that cannot be represented as a
fraction with 32-bit numerator and denominator. It's safer to create a Price object using the constructor.price
- Ex. "1.25"public io.digitalbits.sdk.xdr.Price toXdr()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object