UNPKG

@wca/helpers

Version:

Helpers and class definitions for WCA and WCIF

26 lines 718 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatCentiseconds = void 0; function formatCentiseconds(centiTime) { if (centiTime === -1) { return 'DNF'; } if (centiTime === -2) { return 'DNS'; } var cs = centiTime % 100; var s = Math.floor(centiTime / 100) % 60; var m = Math.floor(centiTime / 6000); if (m > 0) { return "".concat(m, ":").concat(prefix(s), ".").concat(prefix(cs)); } return "".concat(s, ".").concat(prefix(cs)); } exports.formatCentiseconds = formatCentiseconds; function prefix(n) { if (n < 10) { return "0".concat(n); } return "".concat(n); } //# sourceMappingURL=time.js.map