Intl.NumberFormat’s formatToParts doesn’t return group
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 859
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
Description
## Bug Description
On Android 7.1 (API level 25), `Intl.NumberFormat.prototype.formatToParts()` doesn’t return the part of type `group`.
---
On Android 12.0 (API level 31), `Intl.NumberFormat('en-US').formatToParts(1111.11)` returns:
```json
[
{
"type": "integer",
"value": "1"
},
{
"type": "group",
"value": ","
},
{
"type": "integer",
"value": "111"
},
{
"type": "decimal",
"value": "."
},
{
"type": "fraction",
"value": "11"
}
]
```
On Android 7.1 (API level 25), it instead returns:
```json
[
{
"type": "integer",
"value": "1"
},
{
"type": "integer",
"value": ","
},
{
"type": "integer",
"value": "111"
},
{
"type": "decimal",
"value": "."
},
{
"type": "fraction",
"value": "11"
}
]
```
On line 7, instead of `"type": "group"`, `"type": "integer"` is returned.
## Steps to Reproduce
1. `npx react-native init AwesomeProject`
2. `cd AwesomeProject`
3. [Enable Hermes on Android](https://reactnative.dev/docs/hermes#android)
4. `echo "console.log(Intl.NumberFormat('en-US').formatToParts(1111.11))" >> index.js`
5. `npx react-native run-android` on an emulator with API level 25
6. `npx react-native run-android` on an emulator with a higher API level (for example, API level 31)
## Environment
Hermes version: v0.11.0
React Native version: v0.69.3
OS version: Android 7.1 (API level 25) and probably lower
Platform: arm64-v8a
Contributor guide
Assessment
This issue has not been assessed yet.