/**
 * @fileoverview added by tsickle
 * Generated from: utils/common-util.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
var CommonUtil = /** @class */ (function () {
    function CommonUtil() {
    }
    /**
     * Rounds number to given floating point, 2 by default.
     * @param value number from float data type
     * @param digits how many numbers will be shown after decimal point
     */
    /**
     * Rounds number to given floating point, 2 by default.
     * @param {?} value number from float data type
     * @param {?=} digits how many numbers will be shown after decimal point
     * @return {?}
     */
    CommonUtil.roundTo = /**
     * Rounds number to given floating point, 2 by default.
     * @param {?} value number from float data type
     * @param {?=} digits how many numbers will be shown after decimal point
     * @return {?}
     */
    function (value, digits) {
        if (digits === void 0) { digits = 2; }
        if (!value) {
            value = 0;
        }
        return Number(Math.round(Number(value + 'e' + digits)) + 'e-' + digits);
    };
    /**
     * Verifies if the passed value is of type Function
     */
    /**
     * Verifies if the passed value is of type Function
     * @param {?} value
     * @return {?}
     */
    CommonUtil.isFunction = /**
     * Verifies if the passed value is of type Function
     * @param {?} value
     * @return {?}
     */
    function (value) {
        return typeof value === 'function';
    };
    return CommonUtil;
}());
export { CommonUtil };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLXV0aWwuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI6WyJ1dGlscy9jb21tb24tdXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFLQTtJQUFBO0lBbUJBLENBQUM7SUFsQkc7Ozs7T0FJRzs7Ozs7OztJQUNJLGtCQUFPOzs7Ozs7SUFBZCxVQUFlLEtBQWEsRUFBRSxNQUFrQjtRQUFsQix1QkFBQSxFQUFBLFVBQWtCO1FBQzVDLElBQUksQ0FBQyxLQUFLLEVB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