aveta
Version:
Convert long numbers into abbreviated and human-readable strings.
52 lines (51 loc) • 1 kB
TypeScript
/**
* IOptions used to configure Aveta.
*
* precision: number;
*
* digits: number;
*
* separator: string;
*
* lowercase: boolean;
*
* space: boolean;
*
* units: string[];
*/
export interface IOptions {
/**
* Number of significant digits.
*/
precision: number;
/**
* How numbers are rounded: nearest, always up, or always down
* @default 'nearest'
*/
roundingMode?: 'up' | 'down' | 'nearest';
/**
* maximum number of significant digits
*/
digits: number;
/**
* The type of decimal marker (e.g. period ".").
*/
separator: string;
/**
* Convert units to lowercase.
*/
lowercase: boolean;
/**
* Add a space between the number and the unit (e.g : 55.5 K).
*/
space: boolean;
/**
* A list of units to use (e.g : ["K", "M", "B", "T", "P", "E"]).
*/
units: string[];
base: number;
}
/**
* Default options for Aveta.
*/
export declare const Options: IOptions;