MCPcopy Index your code
hub / github.com/yuin/gopher-lua / Format

Method Format

value.go:124–141  ·  view source on GitHub ↗

fmt.Formatter interface

(f fmt.State, c rune)

Source from the content-addressed store, hash-verified

122
123// fmt.Formatter interface
124func (nm LNumber) Format(f fmt.State, c rune) {
125 switch c {
126 case 'q', 's':
127 defaultFormat(nm.String(), f, c)
128 case 'b', 'c', 'd', 'o', 'x', 'X', 'U':
129 defaultFormat(int64(nm), f, c)
130 case 'e', 'E', 'f', 'F', 'g', 'G':
131 defaultFormat(float64(nm), f, c)
132 case 'i':
133 defaultFormat(int64(nm), f, 'd')
134 default:
135 if isInteger(nm) {
136 defaultFormat(int64(nm), f, c)
137 } else {
138 defaultFormat(float64(nm), f, c)
139 }
140 }
141}
142
143type LTable struct {
144 Metatable LValue

Callers

nothing calls this directly

Calls 3

StringMethod · 0.95
defaultFormatFunction · 0.85
isIntegerFunction · 0.85

Tested by

no test coverage detected