func IsNumber(data string) (isNumber bool)
func Number(v float64, f string) string
Number is used to format a number with a format string. If the format string is empty, then General number formatting is used which attempts to mimic Excel's general formatting.
func NumberGeneric(v float64) string
NumberGeneric formats the number with the generic format which attemps to mimic Excel's general formatting.
func String(v string, f string) string
String returns the string formatted according to the type. In format strings this is the fourth item, where '@' is used as a placeholder for text.
func Value(v string, f string) string
Value formats a value as a number or string depending on if it appears to be a number or string.
FmtType is the type of a format token.
type FmtType byte
Format type constants.
const ( FmtTypeLiteral FmtType = iota FmtTypeDigit FmtTypeDigitOpt FmtTypeComma FmtTypeDecimal FmtTypePercent FmtTypeDollar FmtTypeDigitOptThousands FmtTypeUnderscore FmtTypeDate FmtTypeTime FmtTypeFraction FmtTypeText )
func (i FmtType) String() string
Format is a parsed number format.
type Format struct { Whole []Token Fractional []Token Exponent []Token IsExponential bool // contains filtered or unexported fields }
func Parse(s string) []Format
func (f *Format) AddToken(t FmtType, l []byte)
AddToken adds a format token to the format.
type Lexer struct {
// contains filtered or unexported fields
}
func (l *Lexer) Lex(r io.Reader)
Token is a format token in the Excel format string.
type Token struct { Type FmtType Literal byte DateTime string }