diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2019-04-25 03:34:13 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2019-04-25 03:34:13 +0200 |
| commit | 901009cd16b7f456acddf3cbe534e14c8b0304fb (patch) | |
| tree | 84cbc4d63a8c338be3dec566832c733cec68b46a /utils.go | |
| parent | 4a387707386c666b0210259ff8c18d6e9d6a5532 (diff) | |
New Payment Database0.4.0
Diffstat (limited to 'utils.go')
| -rw-r--r-- | utils.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 { |
