Price class

Represents Price. Price in Stellar is represented as a fraction.

Constructors

Price(int n, int d)
Create a new price. Price in Stellar is represented as a fraction.
Price.fromJson(Map<String, dynamic> json)
factory

Properties

d int
getter/setter pair
denominator int?
Returns denominator.
no setter
hashCode int
The hash code for this object.
no setterinherited
n int
getter/setter pair
numerator int?
Returns numerator.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited
toXdr() XdrPrice
Generates Price XDR object.

Operators

operator ==(Object object) bool
The equality operator.
override

Static Methods

fromString(String price) Price
Approximates 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.