UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

27 lines 734 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.str = void 0; const padLeft_1 = require("../text/padLeft"); /** * Converts the given number to string * @param {number} value * @param {number} length * @param {number} decimals * @returns string */ const str = (value, length = 10, decimals = 0) => { let result = value.toFixed(decimals); if (result.length > length) { if (decimals === 0) { return (0, padLeft_1.padLeft)("", length, "*"); } else { return (0, exports.str)(value, length, 0); } } else { return (0, padLeft_1.padLeft)(result, length, " "); } }; exports.str = str; //# sourceMappingURL=str.js.map