Skip to main content
Helpful?

Percent

@uniswap/sdk-core / Exports / Percent

Class: Percent

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Percent(numerator, denominator?)

Parameters

NameType
numeratorBigintIsh
denominatorBigintIsh

Inherited from

Fraction.constructor

Defined in

entities/fractions/fraction.ts:28

Properties

denominator

Readonly denominator: default

Inherited from

Fraction.denominator

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

Fraction.numerator

Defined in

entities/fractions/fraction.ts:25

Accessors

asFraction

get asFraction(): Fraction

Helper method for converting any super class back to a fraction

Returns

Fraction

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

Fraction

Inherited from

Fraction.remainder

Defined in

entities/fractions/fraction.ts:47

Methods

add

add(other): Percent

Parameters

NameType
otherBigintIsh | Fraction

Returns

Percent

Overrides

Fraction.add

Defined in

entities/fractions/percent.ts:21


divide

divide(other): Percent

Parameters

NameType
otherBigintIsh | Fraction

Returns

Percent

Overrides

Fraction.divide

Defined in

entities/fractions/percent.ts:33


equalTo

equalTo(other): boolean

Parameters

NameType
otherBigintIsh | Fraction

Returns

boolean

Inherited from

Fraction.equalTo

Defined in

entities/fractions/fraction.ts:91


greaterThan

greaterThan(other): boolean

Parameters

NameType
otherBigintIsh | Fraction

Returns

boolean

Inherited from

Fraction.greaterThan

Defined in

entities/fractions/fraction.ts:99


invert

invert(): Fraction

Returns

Fraction

Inherited from

Fraction.invert

Defined in

entities/fractions/fraction.ts:51


lessThan

lessThan(other): boolean

Parameters

NameType
otherBigintIsh | Fraction

Returns

boolean

Inherited from

Fraction.lessThan

Defined in

entities/fractions/fraction.ts:83


multiply

multiply(other): Percent

Parameters

NameType
otherBigintIsh | Fraction

Returns

Percent

Overrides

Fraction.multiply

Defined in

entities/fractions/percent.ts:29


subtract

subtract(other): Percent

Parameters

NameType
otherBigintIsh | Fraction

Returns

Percent

Overrides

Fraction.subtract

Defined in

entities/fractions/percent.ts:25


toFixed

toFixed(decimalPlaces?, format?, rounding?): string

Parameters

NameTypeDefault value
decimalPlacesnumber2
format?objectundefined
rounding?Roundingundefined

Returns

string

Overrides

Fraction.toFixed

Defined in

entities/fractions/percent.ts:41


toSignificant

toSignificant(significantDigits?, format?, rounding?): string

Parameters

NameTypeDefault value
significantDigitsnumber5
format?objectundefined
rounding?Roundingundefined

Returns

string

Overrides

Fraction.toSignificant

Defined in

entities/fractions/percent.ts:37

Helpful?