File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
Champion: Eemeli Aro
6
6
7
- Stage: 0
7
+ Stage: 1
8
+
9
+ Presentations:
10
+ - [ For Stage 1] ( https://docs.google.com/presentation/d/1gunNRRXJNdDwqTHh-XjV3ueI8PFasRI9WcF4KfWvxE0/edit?usp=sharing ) (2025.05)
8
11
9
12
## Motivation
10
13
@@ -43,7 +46,16 @@ If accepted, this proposal would change the internals of these interfaces
43
46
such that trailing zeros would be retained,
44
47
and included in the formatted or selected value.
45
48
The treatment of Number or BigInt values would not change,
46
- and options such as ` maximumFractionDigits ` would still work as before.
49
+ and options such as ` maximumFractionDigits ` would still work as before:
50
+
51
+ ``` js
52
+ const nf = new Intl.NumberFormat (' en' , { minimumFractionDigits: 1 });
53
+
54
+ nf .format (' 1' ) === ' 1.0'
55
+ nf .format (' 1.00' ) === ' 1.00'
56
+ nf .format (' 1.0000' ) === ' 1.000'
57
+ // maximumFractionDigits default is 3.
58
+ ```
47
59
48
60
## Background
49
61
@@ -61,6 +73,7 @@ The maximum limit for the fraction precision was increased in 2023 from 20 to 10
61
73
A numerical string representation of a Number with trailing zeros is available as ` Number.prototype.toPrecision ` :
62
74
``` js
63
75
(42 ).toPrecision (4 ) === " 42.00"
76
+ (4200 ).toPrecision (2 ) === " 4.2e+3"
64
77
```
65
78
66
79
<!--
You can’t perform that action at this time.
0 commit comments