Skip to content

Commit 6dce811

Browse files
committed
Updated Join Bytes Method To Accept Floats
1 parent 5451a12 commit 6dce811

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

regex.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ func JoinBytes(bytes ...interface{}) []byte {
5050
res = append(res, []byte(b.(string))...)
5151
case varType["int"]:
5252
res = append(res, []byte(strconv.Itoa(b.(int)))...)
53+
case varType["float64"]:
54+
res = append(res, []byte(strconv.FormatFloat(b.(float64), 'f', -1, 64))...)
55+
case varType["float32"]:
56+
res = append(res, []byte(strconv.FormatFloat(float64(b.(float32)), 'f', -1, 32))...)
5357
}
5458
}
5559
return res

0 commit comments

Comments
 (0)