format

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scale

type Scale struct {
	// contains filtered or unexported fields
}

Scale num's coefficient in string

func New

func New(s string) Scale

num = 123kb scale is 123k

func NewFromNum

func NewFromNum(scaleNum interface{}, r radix.Radix) Scale

func (Scale) FormatScale

func (s Scale) FormatScale(r radix.Radix) (string, error)

format and get string like -123k

func (Scale) FormatScaleFloat

func (s Scale) FormatScaleFloat(r radix.Radix, bitSize int) (string, error)

func (Scale) FormatScaleInt

func (s Scale) FormatScaleInt(r radix.Radix, base int, bitSize int) (string, error)

func (Scale) FormatScaleUint

func (s Scale) FormatScaleUint(r radix.Radix, base int, bitSize int) (string, error)

func (Scale) ParseFloat

func (s Scale) ParseFloat(bitSize int) (num float64, err error)

func (Scale) ParseInt

func (s Scale) ParseInt(base int, bitSize int) (num int64, err error)

func (Scale) ParseNum

func (s Scale) ParseNum() (num interface{}, err error)

parse -123k and get number

func (Scale) ParseNumStr

func (s Scale) ParseNumStr() (num string)

func (Scale) ParseScale

func (s Scale) ParseScale(r radix.Radix) (scale int64, err error)

parse -123k and get num's coeffieient

func (Scale) ParseSign

func (s Scale) ParseSign() (neg bool)

parse -123k and get sign

func (Scale) ParseUint

func (s Scale) ParseUint(base int, bitSize int) (num uint64, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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