/*
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 { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { StringBuilder } from "igniteui-angular-core";
import { markType } from "igniteui-angular-core";
/**
 * @hidden
 */
export class UltraCalcFunctionFixed extends BuiltInFunctionBase {
    evaluate(a, b) {
        let c = 0;
        let d = 2;
        let e = false;
        let f = new StringBuilder(1, 100);
        let g;
        if (2 < b) {
            g = a.pop();
            if (g.isError) {
                return new ExcelCalcValue(g.toErrorValue());
            }
            e = g._toBoolean1();
        }
        if (1 < b) {
            g = a.pop();
            if (g.isError) {
                return new ExcelCalcValue(g.toErrorValue());
            }
            d = g._toInt();
        }
        g = a.pop();
        if (g.isError) {
            return new ExcelCalcValue(g.toErrorValue());
        }
        c = g._toDouble3();
        let h = (c.toLocaleString(a._w.name, { minimumFractionDigits: d, maximumFractionDigits: d, useGrouping: e }));
        if (h == null || h.length == 0) {
            h = "0";
        }
        return new ExcelCalcValue(h);
    }
    get_name() {
        return "fixed";
    }
    get name() {
        return this.get_name();
    }
    get_minArgs() {
        return 1;
    }
    get minArgs() {
        return this.get_minArgs();
    }
    get_maxArgs() {
        return 3;
    }
    get maxArgs() {
        return this.get_maxArgs();
    }
    doesParameterAllowIntermediateResultArray(a, b) {
        return true;
    }
}
UltraCalcFunctionFixed.$t = markType(UltraCalcFunctionFixed, 'UltraCalcFunctionFixed', BuiltInFunctionBase.$);
//# sourceMappingURL=UltraCalcFunctionFixed.js.map