Example #1
0
func StringToFloat(str string) float64 {
	dec, err := strconv.ParseFloat(str, 64)
	if err != nil {
		o.Exit("there was an error converting the type")
	}
	return dec
}
Example #2
0
func StringToBool(str string) bool {
	boo, err := strconv.ParseBool(str)
	if err != nil {
		o.Exit("there was an error converting the type")
	}
	return boo
}
Example #3
0
func StringToInt(str string) int {
	num, err := strconv.Atoi(str)
	if err != nil {
		o.Exit("there was an error converting the type")
	}
	return num
}