jsnumber

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package jsnumber implements ECMAScript numeric conversion and serialization for values that arrive as JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(raw []byte) float64

FromJSON returns ToNumber of the value JSON.parse produces for raw. A nil or empty raw is undefined, which converts to NaN.

func JSON

func JSON(value float64) json.RawMessage

JSON returns JSON.stringify(value): non-finite numbers serialize as null and -0 as 0.

func Parse

func Parse(text string) float64

Parse implements ECMAScript StringToNumber.

func String

func String(value float64) string

String implements Number::toString for base 10.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL