decord/source/13374___exportStarResult21.js
2026-08-05 07:35:12 +00:00

86 lines
3.5 KiB
JavaScript

// Module ID: 13374
// Function ID: 13375
// Name: __exportStarResult21
// Dependencies: [13360, 13358, 13375, 13376, 13377]
// Module 13374 (__exportStarResult21)
const require = arg1;
const dependencyMap = arg6;
arg5.FormatNumericToString = function FormatNumericToString(roundingType, timesResult) {
let formattedString;
let roundedNumber;
if (timesResult.isZero()) {
if (timesResult.isNegative()) {
let ZERO = require(13360) /* TEN */.ZERO;
let str2 = "negative";
let tmp5Result = dependencyMap;
let tmp5 = require;
}
roundingType = roundingType.roundingType;
const result = tmp5(13375).GetUnsignedRoundingMode(roundingType.roundingMode, tmp9);
if ("significantDigits" === roundingType) {
let ToRawPrecisionResult = tmp5(13376).ToRawPrecision(ZERO, roundingType.minimumSignificantDigits, roundingType.maximumSignificantDigits, result);
} else if ("fractionDigits" === roundingType) {
ToRawPrecisionResult = tmp5(13377).ToRawFixed(ZERO, roundingType.minimumFractionDigits, roundingType.maximumFractionDigits, roundingType.roundingIncrement, result);
} else {
const ToRawPrecisionResult1 = tmp5(13376).ToRawPrecision(ZERO, roundingType.minimumSignificantDigits, roundingType.maximumSignificantDigits, result);
let ToRawFixedResult = tmp5(13377).ToRawFixed(ZERO, roundingType.minimumFractionDigits, roundingType.maximumFractionDigits, roundingType.roundingIncrement, result);
if ("morePrecision" === roundingType.roundingType) {
if (ToRawPrecisionResult1.roundingMagnitude <= ToRawFixedResult.roundingMagnitude) {
ToRawFixedResult = ToRawPrecisionResult1;
}
ToRawPrecisionResult = ToRawFixedResult;
} else {
tmp5(13358).invariant("lessPrecision" === roundingType.roundingType, "Invalid roundingType");
ToRawPrecisionResult = ToRawPrecisionResult1;
if (ToRawPrecisionResult1.roundingMagnitude <= ToRawFixedResult.roundingMagnitude) {
ToRawPrecisionResult = ToRawFixedResult;
}
}
}
({ roundedNumber, formattedString } = ToRawPrecisionResult);
let substr = formattedString;
if ("stripIfInteger" === roundingType.trailingZeroDisplay) {
substr = formattedString;
if (roundedNumber.isInteger()) {
const index = formattedString.indexOf(".");
substr = formattedString;
if (index > -1) {
substr = formattedString.slice(0, index);
}
}
}
const integerDigitsCount = ToRawPrecisionResult.integerDigitsCount;
const minimumIntegerDigits = roundingType.minimumIntegerDigits;
let sum = substr;
if (integerDigitsCount < minimumIntegerDigits) {
sum = tmp5(13358).repeat("0", minimumIntegerDigits - integerDigitsCount) + substr;
}
if ("negative" !== str2) {
const obj = { roundedNumber: null, formattedString: null };
obj[0] = roundedNumber;
obj[1] = sum;
return obj;
} else if (roundedNumber.isZero()) {
tmp5Result = tmp5(13360);
let NEGATIVE_ZERO = tmp5Result.NEGATIVE_ZERO;
} else {
NEGATIVE_ZERO = roundedNumber.negated();
}
}
require(13358) /* getMultiInternalSlots */.invariant(timesResult.isFinite(), "NumberFormatDigitInternalSlots value is not finite");
let str = "positive";
if (timesResult.lessThan(0)) {
str = "negative";
}
ZERO = timesResult;
str2 = str;
tmp5Result = tmp2;
tmp5 = tmp;
if ("negative" === str) {
ZERO = timesResult.negated();
str2 = str;
tmp5Result = tmp2;
tmp5 = tmp;
}
};