@formatjs/ecma402-abstract 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/262.d.ts +1 -1
- package/262.js +1 -1
- package/NumberFormat/ApplyUnsignedRoundingMode.d.ts +1 -1
- package/NumberFormat/ComputeExponent.d.ts +1 -1
- package/NumberFormat/ComputeExponent.js +1 -1
- package/NumberFormat/ComputeExponentForMagnitude.d.ts +1 -1
- package/NumberFormat/ComputeExponentForMagnitude.js +0 -2
- package/NumberFormat/FormatNumeric.d.ts +1 -1
- package/NumberFormat/FormatNumericRange.d.ts +1 -1
- package/NumberFormat/FormatNumericRangeToParts.d.ts +1 -1
- package/NumberFormat/FormatNumericToParts.d.ts +1 -1
- package/NumberFormat/FormatNumericToString.d.ts +1 -1
- package/NumberFormat/PartitionNumberPattern.d.ts +1 -1
- package/NumberFormat/PartitionNumberRangePattern.d.ts +1 -1
- package/NumberFormat/ToRawFixed.d.ts +1 -1
- package/NumberFormat/ToRawFixed.js +0 -3
- package/NumberFormat/ToRawPrecision.d.ts +1 -1
- package/NumberFormat/decimal-cache.d.ts +1 -1
- package/NumberFormat/decimal-cache.js +1 -1
- package/NumberFormat/format_to_parts.d.ts +1 -1
- package/NumberFormat/format_to_parts.js +1 -1
- package/ToIntlMathematicalValue.d.ts +1 -1
- package/ToIntlMathematicalValue.js +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +1 -1
- package/package.json +4 -5
- package/types/number.d.ts +1 -1
package/262.d.ts
CHANGED
package/262.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Decimal } from "
|
|
1
|
+
import type { Decimal } from "@formatjs/bigdecimal";
|
|
2
2
|
import { type UnsignedRoundingModeType } from "../types/number.js";
|
|
3
3
|
export declare function ApplyUnsignedRoundingMode(x: Decimal, r1: Decimal, r2: Decimal, unsignedRoundingMode: UnsignedRoundingModeType): Decimal;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Decimal } from "decimal.js";
|
|
2
1
|
import "../types/number.js";
|
|
3
2
|
import { invariant } from "../utils.js";
|
|
4
3
|
import { getPowerOf10 } from "./decimal-cache.js";
|
|
5
|
-
Decimal.set({ toExpPos: 100 });
|
|
6
4
|
/**
|
|
7
5
|
* The abstract operation ComputeExponentForMagnitude computes an exponent by which to scale a
|
|
8
6
|
* number of the given magnitude (power of ten of the most significant digit) according to the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Decimal } from "
|
|
1
|
+
import type { Decimal } from "@formatjs/bigdecimal";
|
|
2
2
|
import { type NumberFormatInternal, type NumberFormatPart } from "../types/number.js";
|
|
3
3
|
export declare function FormatNumericToParts(nf: Intl.NumberFormat, x: Decimal, implDetails: {
|
|
4
4
|
getInternalSlots(nf: Intl.NumberFormat): NumberFormatInternal;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { Decimal } from "decimal.js";
|
|
2
1
|
import "../types/number.js";
|
|
3
2
|
import { repeat } from "../utils.js";
|
|
4
3
|
import { ApplyUnsignedRoundingMode } from "./ApplyUnsignedRoundingMode.js";
|
|
5
4
|
import { getPowerOf10 } from "./decimal-cache.js";
|
|
6
|
-
//IMPL: Setting Decimal configuration
|
|
7
|
-
Decimal.set({ toExpPos: 100 });
|
|
8
5
|
//IMPL: Helper function to calculate raw fixed value
|
|
9
6
|
function ToRawFixedFn(n, f) {
|
|
10
7
|
return n.times(getPowerOf10(-f));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Decimal } from "
|
|
1
|
+
import { Decimal } from "@formatjs/bigdecimal";
|
|
2
2
|
import { type NumberFormatLocaleInternalData, type NumberFormatOptionsCompactDisplay, type NumberFormatOptionsCurrencyDisplay, type NumberFormatOptionsCurrencySign, type NumberFormatOptionsNotation, type NumberFormatOptionsStyle, type NumberFormatOptionsUnitDisplay, type NumberFormatPart, type RoundingModeType, type UseGroupingType } from "../types/number.js";
|
|
3
3
|
interface NumberResult {
|
|
4
4
|
formattedString: string;
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/ecma402-abstract",
|
|
3
3
|
"description": "A collection of implementation for ECMAScript abstract operations",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Long Ho <holevietlong@gmail.com",
|
|
7
7
|
"type": "module",
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
".": "./index.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"@formatjs/
|
|
17
|
-
"@formatjs/intl-localematcher": "0.8.1"
|
|
14
|
+
"@formatjs/bigdecimal": "0.2.0",
|
|
15
|
+
"@formatjs/fast-memoize": "3.1.1",
|
|
16
|
+
"@formatjs/intl-localematcher": "0.8.2"
|
|
18
17
|
},
|
|
19
18
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
20
19
|
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
|
package/types/number.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Decimal } from "
|
|
1
|
+
import type { Decimal } from "@formatjs/bigdecimal";
|
|
2
2
|
import { type LocaleData } from "./core.js";
|
|
3
3
|
import { type LDMLPluralRule } from "./plural-rules.js";
|
|
4
4
|
export type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact";
|