// GetNumber retrieves a number parameter.
GetNumber retrieves a number parameter.
// GetNumber retrieves a number parameter .
func (s State) GetNumber(path string) (float64, error) {
	v, err := s.Get(path)
	if err != nil {
		return 0, err
	}
	if f, ok := v.(float64); ok {
		return f, nil
	}
	if s, ok := v.(string); ok {
		if f, err := strconv.ParseFloat(s, 64); err == nil {
			return f, nil
		}
	}
	return 0, fmt.Errorf("cannot convert %q to float64", v)
}
func ( s State ) GetNumber ( path string ) ( float64 , error ) { v , err := s . Get ( path ) if err != nil { return 0 , err } if f , ok := v . ( float64 ) ; ok { return f , nil } if s , ok := v . ( string ) ; ok { if f , err := strconv . ParseFloat ( s , 64 ) ; err == nil { return f , nil } } return 0 , fmt . Errorf ( " " , v ) }
GetNumber retrieves a number parameter.
GetNumber retrieves a number parameter .
// string -> number coercion.