@stoqey/ibkr
Version:
NodeJS Interactive Brokers wrapper & utilities using @stoqey/ib
16 lines • 462 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatDec = void 0;
var formatDec = function (num, $, places) {
if ($ === void 0) { $ = false; }
if (places === void 0) { places = 2; }
if (!num || isNaN(num)) {
return num || 0;
}
if ($) {
return "$".concat(num.toFixed(places));
}
return num.toLocaleString();
};
exports.formatDec = formatDec;
//# sourceMappingURL=data.utils.js.map