Percent

Responsible for formatting percentages (10% instead of 0.1). Derived from Fraction entity.

Example

import { Percent } from '@tradegen/sdk'

const percent = new Percent('60', '100')
console.log(percent.toSignificant(2)) // 60

Methods

toSignificant

toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string

toFixed

toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string

Last updated