UNPKG

nerdamer-ts

Version:

javascript light-weight symbolic math expression evaluator

30 lines (29 loc) 999 B
/** * Javascript has the toExponential method but this allows you to work with string and therefore any number of digits of your choosing * For example Scientific('464589498449496467924197545625247695464569568959124568489548454'); */ export default class Scientific { sign: number; coeff: string; exponent: string; private decp; private dec?; private wholes?; constructor(value: string | number); static fromScientific(num: string): string[]; static convert(num: string): { coeff: string; exponent: string; decp: number; dec: string; wholes: string; }; round(num: string | number): Scientific; copy(): Scientific; toString(n?: number): string; static isScientific(num: string): boolean; static leadingZeroes(num: string): string; static removeLeadingZeroes(num: string): string; static removeTrailingZeroes(num: string): string; static round(c: string, n: number): string | number; }