Commit 1ee38eb
util: add %i and %f formatting specifiers
This change brings formatting specifiers available in `util.format` and
consequently, `console.*` closer to what is supported in all major
browsers.
- `%i` is introduced to format integer values.
- `%f` is introduced to format floating point values.
Fixes: #10292
PR-URL: #10308
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 5ac719d commit 1ee38ebCopy full SHA for 1ee38eb
File tree
Expand file treeCollapse file tree
3 files changed
+56
-10
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+56
-10
lines changedOpen diff view settings
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
103 | 103 | |
104 | 104 | |
105 | 105 | |
106 | | - |
| 106 | + |
| 107 | + |
| 108 | + |
107 | 109 | |
108 | 110 | |
109 | 111 | |
|
Collapse file
+16Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
89 | 89 | |
90 | 90 | |
91 | 91 | |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
92 | 108 | |
93 | 109 | |
94 | 110 | |
|
Collapse file
test/parallel/test-util-format.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-format.js+37-9Lines changed: 37 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27 | 27 | |
28 | 28 | |
29 | 29 | |
| 30 | + |
| 31 | + |
30 | 32 | |
31 | 33 | |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | 34 | |
37 | | - |
38 | | - |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
39 | 39 | |
40 | | - |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
41 | 60 | |
| 61 | + |
42 | 62 | |
43 | 63 | |
44 | 64 | |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
45 | 75 | |
46 | 76 | |
47 | 77 | |
| ||
50 | 80 | |
51 | 81 | |
52 | 82 | |
53 | | - |
54 | 83 | |
55 | 84 | |
56 | 85 | |
57 | | - |
58 | 86 | |
59 | 87 | |
60 | 88 | |
|
0 commit comments