Im doing some work for uni and I am a beginner at javascript. This is the code that I have:
var canvas;
canvas = openGraphics();
var radius;
radius = 20;
var area;
area = (radius*radius)*Math.PI;
canvas.fillEllipse( 10, 10, 250, 140 );
// drawEllipse, requires four values:
// drawEllipse( x, y, width, height );
// x and y are the coordinates of the top left corner
// width and height are what they say!
canvas.drawString( "Radius of circle:", 10, 250 );
canvas.drawString( radius, 120, 250 );
canvas.drawString( "area of circle", 10, 280 );
canvas.drawString( area, 120, 280 );
canvas.paint();
Can someone please tell me how to limit the amount of decimal places please.