function numberLine( start, end, step, x, y, denominator ) {
	step = step || 1;
	x = x || 0;
	y = y || 0;
	var decPlaces = (step + "").length - (step + "").indexOf(".")-1;
	if(	 (step + "").indexOf(".") < 0){
		decPlaces = 0;
	}
	var graph = KhanUtil.currentGraph;
	var set = graph.raphael.set();
	set.push( graph.line( [x, y], [x + end - start, y] ) );
	for( var i = 0; i <= end - start; i += step ) {
		set.push( graph.line( [x + i, y - 0.2], [x + i, y + 0.2] ) );

		if ( denominator ){
			var base = KhanUtil.roundTowardsZero( start + i + 0.001 );
			var frac = start + i - base;
			var lab = base;

			if (! ( Math.abs ( Math.round( frac * denominator ) )  === denominator || Math.round( frac * denominator )  ===  0 ) ){
				if ( base === 0 ){
					lab = KhanUtil.fraction( Math.round( frac * denominator ),  denominator, false, false, true);
				}
				else{
					lab =  base + "\\frac{" +  Math.abs( Math.round( frac * denominator )) + "}{" + denominator + "}";
				}
			}
			graph.label( [x + i, y - 0.2], lab, "below", { labelDistance: 3 } );
		}
		else {
			graph.label( [x + i, y - 0.2], (start + i).toFixed(decPlaces), "below", { labelDistance: 3 } );
		}
	}
	return set;
}
// Temporary not really following convention file, see #160
Temporary not really following convention file, see #160
Temporary not really following convention file see #160
function numberLine( start, end, step, x, y, denominator ) {
	step = step || 1;
	x = x || 0;
	y = y || 0;
	var decPlaces = (step + "").length - (step + "").indexOf(".")-1;
	if(	 (step + "").indexOf(".") < 0){
		decPlaces = 0;
	}
	var graph = KhanUtil.currentGraph;
	var set = graph.raphael.set();
	set.push( graph.line( [x, y], [x + end - start, y] ) );
	for( var i = 0; i <= end - start; i += step ) {
		set.push( graph.line( [x + i, y - 0.2], [x + i, y + 0.2] ) );
		if ( denominator ){
			var base = KhanUtil.roundTowardsZero( start + i + 0.001 );
			var frac = start + i - base;
			var lab = base;
			if (! ( Math.abs ( Math.round( frac * denominator ) )  === denominator || Math.round( frac * denominator )  ===  0 ) ){
				if ( base === 0 ){
					lab = KhanUtil.fraction( Math.round( frac * denominator ),  denominator, false, false, true);
				}
				else{
					lab =  base + "\\frac{" +  Math.abs( Math.round( frac * denominator )) + "}{" + denominator + "}";
				}
			}
			graph.label( [x + i, y - 0.2], lab, "below", { labelDistance: 3 } );
		}
		else {
			graph.label( [x + i, y - 0.2], (start + i).toFixed(decPlaces), "below", { labelDistance: 3 } );
		}
	}
	return set;
}
function numberLine ( start , end , step , x , y , denominator ) { step = step || 1 ; x = x || 0 ; y = y || 0 ; var decPlaces = ( step + "" ) . length - ( step + "" ) . indexOf ( "." ) - 1 ; if ( ( step + "" ) . indexOf ( "." ) < 0 ) { decPlaces = 0 ; } var graph = KhanUtil . currentGraph ; var set = graph . raphael . set ( ) ; set . push ( graph . line ( [ x , y ] , [ x + end - start , y ] ) ) ; for ( var i = 0 ; i <= end - start ; i += step ) { set . push ( graph . line ( [ x + i , y - 0.2 ] , [ x + i , y + 0.2 ] ) ) ; if ( denominator ) { var base = KhanUtil . roundTowardsZero ( start + i + 0.001 ) ; var frac = start + i - base ; var lab = base ; if ( ! ( Math . abs ( Math . round ( frac * denominator ) ) === denominator || Math . round ( frac * denominator ) === 0 ) ) { if ( base === 0 ) { lab = KhanUtil . fraction ( Math . round ( frac * denominator ) , denominator , false , false , true ) ; } else { lab = base + "\\frac{" + Math . abs ( Math . round ( frac * denominator ) ) + "}{" + denominator + "}" ; } } graph . label ( [ x + i , y - 0.2 ] , lab , "below" , { labelDistance : 3 } ) ; } else { graph . label ( [ x + i , y - 0.2 ] , ( start + i ) . toFixed ( decPlaces ) , "below" , { labelDistance : 3 } ) ; } } return set ; }
Temporary not really following convention file, see #160
Temporary not really following convention file see #160