Parsing an integer value when JSON contains a decimal point
See original GitHub issuelet result : int ParseResult = parseJSON "1.1"
let (Choice1Of2 value) = result
//val value : int = 1
I feel this is incorrect and should instead result in a failure. There’s possibly other similar edge cases like this one.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
How to prevent removing decimal point when parsing JSON?
How to prevent removing decimal point when parsing JSON? · 2. JavaScript doesn't have distinct integer and floating point number types. · 1....
Read more >Parsing Decimal values from JSON - Using Swift
I am trying to find a way to parse a number as Decimal without losing the number's precision. It seems that the JSON...
Read more >Parsing JSON numbers and decimal point character
The number values in the returned JSON string are always supplied with a dot (".") for decimal point. It seems like JsonParser.
Read more >Parsing JSON data for int and float - Power Platform Community
However, it often is not a whole number, and has decimal points, as it is currency. ... Change your Parse JSON Schema integer...
Read more >Numeric types — Understanding JSON Schema 2020-12 ...
JSON does not have distinct types for integers and floating-point values. Therefore, the presence or absence of a decimal point is not enough...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like F# Data us fixing this as well: https://www.nuget.org/packages/FSharp.Data/3.0.0-beta4 :
I’ve added a PR that documents the behavior. Note that Fsharp.Data works the way you want.