Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (39 sloc) 1.955 kB
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
<title>Converting fractions to decimals</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars" data-ensure="getGCD( NUMERATOR, DENOMINATOR ) === 1">
<var id="NUMERATOR">randRange( 1, 30 )</var>
<var id="DENOMINATOR">randRange( NUMERATOR + 1, 30 )</var>
<var id="DECIMAL_4">Math.floor( NUMERATOR / DENOMINATOR * 10000 ) / 10000</var>
<var id="DECIMAL">roundTo( 3, NUMERATOR / DENOMINATOR )</var>
</div>
<p>Express the fraction as a decimal, rounded to the thousandth.</p>
<p class="question"><code>\dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
<p class="solution" data-type="decimal"><var>DECIMAL</var></p>
<div class="hints">
<p>This fraction represents the result of dividing <code><var>NUMERATOR</var></code> by <code><var>DENOMINATOR</var></code>.</p>
<div class="graphie" id="nmbrs">
graph.divider = new Divider( DENOMINATOR, NUMERATOR * 10000, 0, 4 );
graph.divider.show();
DUMMY = Array( graph.divider.getNumHints() );
</div>
<div class="graphie" data-update="nmbrs">
graph.divider.shiftDecimals();
</div>
<div class="graphie" data-update="nmbrs" data-each="Divider.numHintsFor( DENOMINATOR, NUMERATOR * 10000, 0, 4 ) times">
graph.divider.showHint();
</div>
<p>Rounding <code><var>DECIMAL_4.toFixed( 4 )</var></code> to the thousandths place gives <code><var>DECIMAL.toFixed( 3 )</var></code>.</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.