June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package currency import ( "errors" "strconv" "strings" ) // ConvertStringDollarsToPennies takes a dollar amount // as a string, i.e. 1.00, 55.12 etc and converts it // into an int64 func ConvertStringDollarsToPennies(amount string) (int64, error) { // check if amount can convert to a valid float _, err := strconv.ParseFloat(amount, 64) if err != nil { return 0, err } // split ...Read now
Unlock full access