package svg

import (
	
	
	
)

// FormatFloat serializes an SVG coordinate with the same six decimal places
// as %f, but omits redundant trailing zeros. Keeping the original rounding is
// important: formatting the full float or reducing precision changes geometry.
func ( float64) string {
	// Most laid-out coordinates are integers. Avoid allocating and formatting
	// a fractional part only to remove it again. The upper bound is exclusive
	// because float64(math.MaxInt64) rounds up to 2^63.
	if  >= -0x1p63 &&  < 0x1p63 {
		 := int64()
		if  == float64() {
			if  == 0 && math.Signbit() {
				return "-0"
			}
			return strconv.FormatInt(, 10)
		}
	}
	 := strconv.FormatFloat(, 'f', 6, 64)
	if strings.Contains(, ".") {
		 = strings.TrimRight(, "0")
		 = strings.TrimSuffix(, ".")
	}
	return 
}