Skip to content

encoding/json: JSON number serialization differs from ES6/V8 #14135

Closed
@cyberphone

Description

@cyberphone

The following program (written by a complete go n00b)

package main

import "fmt"
import "encoding/json"

func main() {
    mapD := map[string]float64{"apple": 5e-6, "lettuce": 0.0}
    mapB, _ := json.Marshal(mapD)
    fmt.Println(string(mapB))
}

returns

{"apple":5e-06,"lettuce":0}

it should rather return

{"apple":0.000005,"lettuce":0}

Rationale for this request:
chakra-core/ChakraCore#149

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions