prompt for a value and return a float type value

PHOTO EMBED

Sun Nov 13 2022 11:47:32 GMT+0000 (UTC)

Saved by @Plastikov #go

func getFloatValue(text string) float64 {
	var value float64
	fmt.Printf("Enter %s: ", text)
	_, err := fmt.Scan(&value)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	return value
}
content_copyCOPY