hatmill/attribute/coords.go

20 lines
370 B
Go
Raw Normal View History

2019-05-30 04:41:04 +00:00
package attribute
import (
"strconv"
"strings"
"gitlab.codemonkeysoftware.net/b/hatmill"
)
func Coords(values ...float32) hatmill.Attrib {
s := make([]string, 0, len(values))
for _, value := range values {
s = append(s, strconv.FormatFloat(float64(value), 'G', -1, 32))
}
return hatmill.Attrib{
Key: "coords",
Value: String(strings.Join(s, ",")),
2019-05-30 04:41:04 +00:00
}
}