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
read / write
denominator int
Returns denominator.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
n int
read / write
numerator int
Returns numerator.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.