HaxeFoundation / HaxeFoundation/haxe
Float to int conversion when stringifying and parsing Json.
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
The json resulting from pretty printing a float value that is exactly an integer doesn't include any period. As a result, when parsing the json again, the same value is interpreted as an integer.
The following example illustrate the problem, but does not involve json pretty-printing or parsing.
```
class Main {
static function main() {
var v : Float = 1.0;
trace(v);
}
}
```
It would be convenient if the pretty-printer used when stringifying json always included a float signifier.
Contributor guide
Assessment
This issue has not been assessed yet.