MCPcopy Create free account
hub / github.com/microsoft/typescript-go / stringToFloat64

Function stringToFloat64

internal/jsnum/string.go:275–284  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

273}
274
275func stringToFloat64(s string) float64 {
276 if f, err := strconv.ParseFloat(s, 64); err == nil {
277 return f
278 } else {
279 if errors.Is(err, strconv.ErrRange) {
280 return f
281 }
282 }
283 return math.NaN()
284}
285
286func isAllDigits(s string) bool {
287 for _, r := range s {

Callers 1

parseFloatStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected