Skip to content
petercollingridge edited this page Feb 1, 2012 · 5 revisions

Coordinates in SVGs are often given to four or more decimal places, which is almost never necessary. In most cases one decimal place will be sufficient.

To set the number of decimal places to x, call: svg.setDecimalPlaces(x)

The parameter, x, can be 0 or any positive integer. If a parameter has less than x decimal places, then it will be unchanged.

The attributes currently affected by setDecimalPlaces are:

  • x, y, x1, y2, x2, y2
  • cx, cy
  • r, rx, ry
  • width, height
  • points
  • d Note that transforms are not currently affected.
Clone this wiki locally