/**
 * The base class for unit formats.
 */
export class UnitFormat {
    /**
     * Formats a number value to a string.
     * For nullish values or values that result in an exception being thrown, empty string is returned
     */
    format(value) {
        if (typeof value !== 'number') {
            return '';
        }
        try {
            return this.tryFormat(value);
        }
        catch {
            return '';
        }
    }
}
//# sourceMappingURL=unit-format.js.map