summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2019-04-25 03:34:13 +0200
committerNikolaus Gotsche <n@softwarefools.com>2019-04-25 03:34:13 +0200
commit901009cd16b7f456acddf3cbe534e14c8b0304fb (patch)
tree84cbc4d63a8c338be3dec566832c733cec68b46a /utils.go
parent4a387707386c666b0210259ff8c18d6e9d6a5532 (diff)
New Payment Database0.4.0
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/utils.go b/utils.go
index c9503ff..9e59d75 100644
--- a/utils.go
+++ b/utils.go
@@ -223,6 +223,27 @@ func stringArray2String(in []string, delim string) string {
return out
}
+func IntArray2String(in []int, delim string) (out string) {
+ for i,a := range in {
+ if i == 0 {
+ out = fmt.Sprintf("%v",a)
+ } else {
+ out = fmt.Sprintf("%s%s%v", out, delim, a)
+ }
+ }
+ return
+}
+
+func String2IntArray(in, delim string) (out []int) {
+ read := strings.Split(in, delim)
+ for _, s := range read {
+ is, err := strconv.Atoi(s)
+ checkErr(err)
+ out = append(out, is)
+ }
+ return
+}
+
func string2FloatArray(in string, delim string) (out []float64) {
read := strings.Split(in, delim)
for _, s := range read {