decord/source/13666___exportStarResult24.js
2026-08-24 06:08:38 +00:00

92 lines
3.1 KiB
JavaScript

// Module ID: 13666
// Function ID: 13667
// Name: __exportStarResult24
// Dependencies: [1281, 13639, 13661, 13640, 13654, 13656]
// Exports: PartitionNumberPattern
// Module 13666 (__exportStarResult24)
import digitsToString from "digitsToString" /* 13639 */;
import getMultiInternalSlots from "getMultiInternalSlots" /* 13640 */;
import __exportStarResult13 from "__exportStarResult13" /* 13654 */;
import __exportStarResult21 from "__exportStarResult21" /* 13656 */;
import formatToParts from "formatToParts" /* 13661 */;
import e from "e" /* 1281 */;
let closure_2 = e.__importDefault(digitsToString);
let closure_3 = e.__importDefault(formatToParts);
export const PartitionNumberPattern = function PartitionNumberPattern(internalSlots, isNaN) {
({ pl, dataLocaleData } = internalSlots);
const tmp = dataLocaleData.numbers.symbols[internalSlots.numberingSystem] || dataLocaleData.numbers.symbols[dataLocaleData.numbers.nu[0]];
if (isNaN.isNaN()) {
formattedString = tmp.nan;
let num = 0;
let num2 = 0;
roundedNumber = isNaN;
} else if (isNaN.isFinite()) {
let num3 = 0;
let timesResult1 = isNaN;
if (!isNaN.isZero()) {
getMultiInternalSlots.invariant(isNaN.isFinite(), "Input must be a mathematical value");
let timesResult = isNaN;
if ("percent" == internalSlots.style) {
timesResult = isNaN.times(100);
}
[tmp7, num4] = __exportStarResult13.ComputeExponent(internalSlots, timesResult);
timesResult1 = timesResult.times(mod.default.pow(10, -tmp7));
num3 = tmp7;
const ComputeExponentResult = __exportStarResult13.ComputeExponent(internalSlots, timesResult);
const _default = mod.default;
const tmp3 = require;
}
const result = __exportStarResult21.FormatNumericToString(internalSlots, timesResult1);
({ formattedString, roundedNumber } = result);
num = num3;
num2 = num4;
} else {
formattedString = tmp.infinity;
num = 0;
num2 = 0;
roundedNumber = isNaN;
}
const signDisplay = internalSlots.signDisplay;
let num7 = 0;
if ("never" !== signDisplay) {
if ("auto" === signDisplay) {
if (roundedNumber.isPositive()) {
let num12 = 0;
} else {
num12 = -1;
}
num7 = num12;
} else if ("always" === signDisplay) {
if (roundedNumber.isPositive()) {
let num11 = 1;
} else {
num11 = -1;
}
num7 = num11;
} else if ("exceptZero" === signDisplay) {
let num9 = 0;
if (!roundedNumber.isZero()) {
let num10 = 1;
if (roundedNumber.isNegative()) {
num10 = -1;
}
num9 = num10;
}
num7 = num9;
} else {
getMultiInternalSlots.invariant("negative" === signDisplay, "signDisplay must be \"negative\"");
let num8 = 0;
if (roundedNumber.isNegative()) {
num8 = 0;
if (!roundedNumber.isZero()) {
num8 = -1;
}
}
num7 = num8;
}
}
return closure_3.default({ roundedNumber, formattedString, exponent: num, magnitude: num2, sign: num7 }, internalSlots.dataLocaleData, pl, internalSlots);
};