MCPcopy Index your code
hub / github.com/Shopify/go-lua / ToNumber

Method ToNumber

lua.go:1402–1402  ·  view source on GitHub ↗

ToNumber converts the Lua value at index to the Go type for a Lua number (float64). The Lua value must be a number or a string convertible to a number. If the operation failed, the second return value will be false. http://www.lua.org/manual/5.2/manual.html#lua_tonumberx

(index int)

Source from the content-addressed store, hash-verified

1400//
1401// http://www.lua.org/manual/5.2/manual.html#lua_tonumberx
1402func (l *State) ToNumber(index int) (float64, bool) { return l.toNumber(l.indexToValue(index)) }
1403
1404// ToBoolean converts the Lua value at index to a Go boolean. Like all
1405// tests in Lua, the only false values are false booleans and nil.

Callers 4

ExampleFunctionFunction · 0.80
base.goFile · 0.80
writeFunction · 0.80
CheckNumberFunction · 0.80

Calls 2

toNumberMethod · 0.95
indexToValueMethod · 0.95

Tested by 1

ExampleFunctionFunction · 0.64