types

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Number

type Number float64

Number represents a floating point number, and implements json.Unmarshaller and json.Marshaller

func (Number) Decimal

func (f Number) Decimal() decimal.Decimal

Decimal returns a decimal.Decimal

func (Number) Float64

func (f Number) Float64() float64

Float64 returns the underlying float64

func (Number) Int64

func (f Number) Int64() int64

Int64 returns the truncated integer component of the number

func (Number) MarshalJSON

func (f Number) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler by formatting to a json string 1337.37 will marshal to "1337.37" 0 will marshal to an empty string: ""

func (Number) String

func (f Number) String() string

String returns a string representation of the number

func (*Number) UnmarshalJSON

func (f *Number) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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