Percent
@uniswap/sdk-core / Exports / Percent
Class: Percent
Hierarchy
↳
Percent
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Percent(numerator
, denominator?
)
Parameters
Name | Type |
---|---|
numerator | BigintIsh |
denominator | BigintIsh |
Inherited from
Defined in
entities/fractions/fraction.ts:28
Properties
denominator
• Readonly
denominator: default
Inherited from
Defined in
entities/fractions/fraction.ts:26
isPercent
• Readonly
isPercent: true
This boolean prevents a fraction from being interpreted as a Percent
Defined in
entities/fractions/percent.ts:19
numerator
• Readonly
numerator: default
Inherited from
Defined in
entities/fractions/fraction.ts:25
Accessors
asFraction
• get
asFraction(): Fraction
Helper method for converting any super class back to a fraction
Returns
Inherited from
Fraction.asFraction
Defined in
entities/fractions/fraction.ts:154
quotient
• get
quotient(): default
Returns
default
Inherited from
Fraction.quotient
Defined in
entities/fractions/fraction.ts:42
remainder
• get
remainder(): Fraction
Returns
Inherited from
Fraction.remainder
Defined in
entities/fractions/fraction.ts:47
Methods
add
▸ add(other
): Percent
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Overrides
Defined in
entities/fractions/percent.ts:21
divide
▸ divide(other
): Percent
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Overrides
Defined in
entities/fractions/percent.ts:33
equalTo
▸ equalTo(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Inherited from
Defined in
entities/fractions/fraction.ts:91
greaterThan
▸ greaterThan(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Inherited from
Defined in
entities/fractions/fraction.ts:99
invert
▸ invert(): Fraction
Returns
Inherited from
Defined in
entities/fractions/fraction.ts:51
lessThan
▸ lessThan(other
): boolean
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
boolean
Inherited from
Defined in
entities/fractions/fraction.ts:83
multiply
▸ multiply(other
): Percent
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Overrides
Defined in
entities/fractions/percent.ts:29
subtract
▸ subtract(other
): Percent
Parameters
Name | Type |
---|---|
other | BigintIsh | Fraction |
Returns
Overrides
Defined in
entities/fractions/percent.ts:25
toFixed
▸ toFixed(decimalPlaces?
, format?
, rounding?
): string
Parameters
Name | Type | Default value |
---|---|---|
decimalPlaces | number | 2 |
format? | object | undefined |
rounding? | Rounding | undefined |
Returns
string
Overrides
Defined in
entities/fractions/percent.ts:41
toSignificant
▸ toSignificant(significantDigits?
, format?
, rounding?
): string
Parameters
Name | Type | Default value |
---|---|---|
significantDigits | number | 5 |
format? | object | undefined |
rounding? | Rounding | undefined |
Returns
string