number

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const LastReservedID = 163

LastReservedID is id of last built-in/reserved format

Variables

This section is empty.

Functions

func Default

func Default(t Type) (int, string)

Default returns default ID and code of number format for type

func Format

func Format(value, code string, t primitives.CellType) string

Format tries to format value into required format code

func IsBuiltIn

func IsBuiltIn(id int) bool

IsBuiltIn returns true if id is one of built-in

func New

func New(id int, code string) ml.NumberFormat

New create and return ml.NumberFormat type for provided values, respecting built-in number formats

func Normalize

func Normalize(nf ml.NumberFormat) ml.NumberFormat

Normalize tries resolve provided format via list of built-in formats and returns one of built-in or original format

func Resolve

func Resolve(nf ml.NumberFormat) *builtInFormat

Resolve looks through built-in number formats and return related if there is any

Types

type Type

type Type byte

Type of underlying value of built-in number format

const (
	General Type = iota
	Integer
	Float
	Date
	Time
	DateTime
	DeltaTime
)

List of all possible types for Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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