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
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter