Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
feat(rome_json_formatter): JSON Formatting number #2570
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov committed Dec 22, 2022
1 parent f6b959a commit db50bf0
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
27 changes: 27 additions & 0 deletions crates/rome_json_formatter/tests/specs/json/number.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
" s p a c e d ": [
1, 2, 3,

4, 5, 6, 7
]
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
2.00000
]
81 changes: 81 additions & 0 deletions crates/rome_json_formatter/tests/specs/json/number.json.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info: json/number.json
---

# Input

```json
[
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
" s p a c e d ": [
1, 2, 3,
4, 5, 6, 7
]
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
2.00000
]
```


=============================

# Outputs

## Output 1

-----
Indent style: Tab
Line width: 80
-----

```json
[
{
"integer": 1234567890,
"real": -9876.54321,
"e": 0.123456789e-12,
"E": 1.23456789e34,
"": 23456789012e66,
"zero": 0,
"one": 1,
" s p a c e d ": [
1, 2, 3,
4, 5, 6, 7
]
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
2.0
]
```


0 comments on commit db50bf0

Please sign in to comment.