Files
bootdotdev-fcc-learn-golang…/course/6-errors/exercises/2-formatting_strings/complete.go
wagslane 9be3074de6 first
2023-05-01 15:25:27 -06:00

28 lines
537 B
Go

package main
import (
"fmt"
)
func getSMSErrorString(cost float64, recipient string) string {
return fmt.Sprintf("SMS that costs $%.2f to be sent to '%v' can not be sent",
cost,
recipient,
)
}
// don't edit below this line
func test(cost float64, recipient string) {
s := getSMSErrorString(cost, recipient)
fmt.Println(s)
fmt.Println("====================================")
}
func main() {
test(1.4, "+1 (435) 555 0923")
test(2.1, "+2 (702) 555 3452")
test(32.1, "+1 (801) 555 7456")
test(14.4, "+1 (234) 555 6545")
}