Skip to content

FSharp.Data.Json serializes some floats as ints #1356

@pbiggar

Description

@pbiggar

The float 100.0 gets serialized as 100, not as "100.0". This throws away the fact that it's a float, and violates the downstream contracts which expect a float here. AFAICT, there is no way to make it print as a float.

To reproduce in fsi:

> FSharp.Data.JsonValue.Parse("100.0").ToString();;
val it : string = "100.0"

> FSharp.Data.JsonValue.Float(100.0).ToString();;
val it : string = "100"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions