"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMicrometerFormat = createMicrometerFormat;
const bignumber_js_1 = __importDefault(require("bignumber.js"));
function createMicrometerFormat() {
    return () => {
        return {
            cell(value) {
                const valueNumber = new bignumber_js_1.default(value);
                const valueTypeVerify = typeof value === 'string' || typeof value === 'number';
                const valueIsLikeNumber = typeof valueNumber.toNumber() === 'number';
                const canMicrometer = valueTypeVerify && valueIsLikeNumber;
                if (canMicrometer) {
                    return valueNumber.toFormat();
                }
                return value;
            },
        };
    };
}
