/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, markType } from "igniteui-react-core/ES2015/type";
import { INumberAbbreviator_$type } from "./INumberAbbreviator";
import { numberToString2 } from "igniteui-react-core/ES2015/numberExtended";
/**
 * @hidden
 */
export class NumberAbbreviator extends Base {
    abbreviate(a) {
        let b = "0.#";
        let c = Math.abs(a);
        let d = ['Q', 'T', 'B', 'M', 'K'];
        let e = [1E+15, 1000000000000, 1000000000, 1000000, 1000];
        for (let f = 0; f < d.length; f++) {
            if (c >= e[f]) {
                return numberToString2((a / e[f]), b) + d[f];
            }
        }
        return a.toString();
    }
}
NumberAbbreviator.$t = markType(NumberAbbreviator, 'NumberAbbreviator', Base.$, [INumberAbbreviator_$type]);
