summaryrefslogtreecommitdiff
path: root/int.go
diff options
context:
space:
mode:
Diffstat (limited to 'int.go')
-rw-r--r--int.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/int.go b/int.go
index 45186c7..dcf6b1e 100644
--- a/int.go
+++ b/int.go
@@ -19,3 +19,13 @@ func Int(s string) int {
}
return i
}
+
+func Int64(s string) int64 {
+ s = Chomp(s)
+ i, err := strconv.Atoi(s)
+ if (err != nil) {
+ handleError(err, -1)
+ return 0
+ }
+ return int64(i)
+}