MCPcopy Create free account
hub / github.com/Monibuca/engine / ToFloat64

Function ToFloat64

util/convert.go:358–386  ·  view source on GitHub ↗
(num interface{})

Source from the content-addressed store, hash-verified

356 return b
357}
358func ToFloat64(num interface{}) float64 {
359 switch v := num.(type) {
360 case uint:
361 return float64(v)
362 case int:
363 return float64(v)
364 case uint8:
365 return float64(v)
366 case uint16:
367 return float64(v)
368 case uint32:
369 return float64(v)
370 case uint64:
371 return float64(v)
372 case int8:
373 return float64(v)
374 case int16:
375 return float64(v)
376 case int32:
377 return float64(v)
378 case int64:
379 return float64(v)
380 case float64:
381 return v
382 case float32:
383 return float64(v)
384 }
385 return 0
386}
387
388func Conf2Listener(conf string) (protocol string, ports []uint16) {
389 var port string

Callers 1

MarshalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected