Fraction
@uniswap/sdk-core / Exports / Fraction
Class: Fraction
Hierarchy
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Fraction(numerator
, denominator?
)
Parameters
Name | Type |
---|---|
numerator | BigintIsh |
denominator | BigintIsh |
Defined in
entities/fractions/fraction.ts:28
Properties
denominator
• Readonly
denominator: default
Defined in
entities/fractions/fraction.ts:26
numerator
• Readonly
numerator: default
Defined in
entities/fractions/fraction.ts:25
Accessors
asFraction
• get
asFraction(): Fraction
Helper method for converting any super class back to a fraction
Returns
Defined in
entities/fractions/fraction.ts:154
quotient
• get
quotient(): default
Returns
default
Defined in
entities/fractions/fraction.ts:42
remainder
• get
remainder(): Fraction
Returns
Defined in
entities/fractions/fraction.ts:47
Methods
add
▸ add(other
): Fraction
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Defined in
entities/fractions/fraction.ts:55
divide
▸ divide(other
): Fraction
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Defined in
entities/fractions/fraction.ts:115
equalTo
▸ equalTo(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Defined in
entities/fractions/fraction.ts:91
greaterThan
▸ greaterThan(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Defined in
entities/fractions/fraction.ts:99
invert
▸ invert(): Fraction
Returns
Defined in
entities/fractions/fraction.ts:51
lessThan
▸ lessThan(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Defined in
entities/fractions/fraction.ts:83
multiply
▸ multiply(other
): Fraction
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Defined in
entities/fractions/fraction.ts:107
subtract
▸ subtract(other
): Fraction
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Defined in
entities/fractions/fraction.ts:69
toFixed
▸ toFixed(decimalPlaces
, format?
, rounding?
): string
Parameters
Name | Type | Default value |
---|---|---|
decimalPlaces | number | undefined |
format | object | undefined |
rounding | Rounding | Rounding.ROUND_HALF_UP |
Returns
string
Defined in
entities/fractions/fraction.ts:138
toSignificant
▸ toSignificant(significantDigits
, format?
, rounding?
): string
Parameters
Name | Type | Default value |
---|---|---|
significantDigits | number | undefined |
format | object | undefined |
rounding | Rounding | Rounding.ROUND_HALF_UP |
Returns
string
Defined in
entities/fractions/fraction.ts:123
tryParseFraction
▸ Static
Private
tryParseFraction(fractionish
): Fraction
Parameters
Name | Type |
---|---|
fractionish | BigintIsh | Fraction |