This repository has been archived by the owner on May 11, 2021. It is now read-only.
/
converting_fractions_to_decimals.html
44 lines (39 loc) · 1.91 KB
/
converting_fractions_to_decimals.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!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.round( 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>