ripple-api/common/int.go

10 lines
167 B
Go
Raw Permalink Normal View History

package common
2016-06-13 20:40:01 +00:00
import "strconv"
// Int converts s to an int. If s in an invalid int, it defaults to 0.
func Int(s string) int {
r, _ := strconv.Atoi(s)
return r
}