round from float32 precision

This commit is contained in:
Gavin Nishizawa 2023-01-24 15:43:47 -08:00
parent c12e71af15
commit f30fe2c2c4
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -317,5 +317,6 @@ func (labelPosition Position) GetPointOnRoute(route geo.Route, strokeWidth, labe
// TODO probably use math.Big
func chopPrecision(f float64) float64 {
return math.Round(f*10000) / 10000
// bring down to float32 precision before rounding for consistency across architectures
return math.Round(float64(float32(f*10000)) / 10000)
}