MCPcopy Create free account
hub / github.com/araddon/qlbridge / NewNumberStr

Function NewNumberStr

expr/node.go:672–675  ·  view source on GitHub ↗

NewNumberStr is a little weird in that this Node accepts string @text and uses go to parse into Int, AND Float.

(text string)

Source from the content-addressed store, hash-verified

670// NewNumberStr is a little weird in that this Node accepts string @text
671// and uses go to parse into Int, AND Float.
672func NewNumberStr(text string) (*NumberNode, error) {
673 n := &NumberNode{Text: text}
674 return n, n.load()
675}
676func NewNumber(fv float64) (*NumberNode, error) {
677 n := &NumberNode{Float64: fv, IsFloat: true}
678 iv := int64(fv)

Callers 2

TestNumberParseFunction · 0.92
vMethod · 0.85

Calls 1

loadMethod · 0.95

Tested by 1

TestNumberParseFunction · 0.74