Skip to content

Commit

Permalink
doc: update toExponential, toFixed and toPrecision docs with rm mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nutboltu committed Aug 24, 2020
1 parent 021ff7e commit e8a74a3
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions doc/bigAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,14 @@ <h5 id="times">


<h5 id="toE">
toExponential<code class='inset'>.toExponential(dp) &rArr;
toExponential<code class='inset'>.toExponential(dp, rm) &rArr;
<i>string</i></code>
</h5>
<p><code>dp</code>? : <i>number</i> : integer, 0 to 1e+6 inclusive</p>
<p>
<code>dp</code>? : <i>number</i> : integer, 0 to 1e+6 inclusive
<br />
<code>rm</code>? : <i>number</i> : 0, 1, 2 or 3
</p>
<p>
Returns a string representing the value of this Big number in exponential
notation to a fixed number of <code>dp</code> decimal places.
Expand All @@ -668,7 +672,7 @@ <h5 id="toE">
If the value of this Big number in exponential notation has more digits to
the right of the decimal point than is specified by <code>dp</code>, the
return value will be rounded to <code>dp</code> decimal places using
rounding mode <a href='#rm'><code>Big.RM</code></a>.
rounding mode <a href='#rm'><code>rm</code></a>.
</p>
<p>
If the value of this Big number in exponential notation has fewer digits
Expand All @@ -678,10 +682,12 @@ <h5 id="toE">
<p>
If <code>dp</code> is omitted or is undefined, the number of digits
after the decimal point defaults to the minimum number of digits
necessary to represent the value exactly.
necessary to represent the value exactly.<br />
if <code>rm</code> is omitted or is undefined, the current
<a href='#rm'><code>Big.RM</code></a> setting is used.
</p>
<p>
Throws if <code>dp</code> is invalid.
Throws if <code>dp</code> or <code>rm</code> is invalid.
</p>
<pre>
x = 45.6
Expand All @@ -698,11 +704,13 @@ <h5 id="toE">


<h5 id="toF">
toFixed<code class='inset'>.toFixed(dp) &rArr;
toFixed<code class='inset'>.toFixed(dp, rm) &rArr;
<i>string</i></code>
</h5>
<p>
<code>dp</code>? : <i>number</i> : integer, 0 to 1e+6 inclusive
<br />
<code>rm</code>? : <i>number</i> : 0, 1, 2 or 3
</p>
<p>
Returns a string representing the value of this Big number in normal
Expand All @@ -712,7 +720,7 @@ <h5 id="toF">
If the value of this Big number in normal notation has more digits to the
right of the decimal point than is specified by <code>dp</code>, the
return value will be rounded to <code>dp</code> decimal places using
rounding mode <a href='#rm'><code>Big.RM</code></a>.
rounding mode <a href='#rm'><code>rm</code></a>.
</p>
<p>
If the value of this Big number in normal notation has fewer fraction
Expand All @@ -728,10 +736,12 @@ <h5 id="toF">
If <code>dp</code> is omitted or is undefined, the return value is
simply the value in normal notation. This is also unlike
<code>Number.prototype.toFixed</code>, which returns the value to zero
decimal places.
decimal places.<br />
if <code>rm</code> is omitted or is undefined, the current
<a href='#rm'><code>Big.RM</code></a> setting is used.
</p>
<p>
Throws if <code>dp</code> is invalid.
Throws if <code>dp</code> or <code>rm</code> is invalid.
</p>
<pre>
x = 45.6
Expand All @@ -745,10 +755,14 @@ <h5 id="toF">


<h5 id="toP">
toPrecision<code class='inset'>.toPrecision(sd) &rArr;
toPrecision<code class='inset'>.toPrecision(sd, rm) &rArr;
<i>string</i></code>
</h5>
<p><code>sd</code>? : <i>number</i> : integer, 1 to 1e+6 inclusive</p>
<p>
<code>sd</code>? : <i>number</i> : integer, 1 to 1e+6 inclusive
<br />
<code>rm</code>? : <i>number</i> : 0, 1, 2 or 3
</p>
<p>
Returns a string representing the value of this Big number to the
specified number of <code>sd</code> significant digits.
Expand All @@ -757,7 +771,7 @@ <h5 id="toP">
If the value of this Big number has more digits than is specified by
<code>sd</code>, the return value will be rounded to <code>sd</code>
significant digits using rounding mode
<a href='#rm'><code>Big.RM</code></a>.
<a href='#rm'><code>rm</code></a>.
</p>
<p>
If the value of this Big number has fewer digits than is specified by
Expand All @@ -770,10 +784,12 @@ <h5 id="toP">
</p>
<p>
If <code>sd</code> is omitted or is undefined, the return value is
the same as <code>.toString()</code>.
the same as <code>.toString()</code>.<br />
if <code>rm</code> is omitted or is undefined, the current
<a href='#rm'><code>Big.RM</code></a> setting is used.
</p>
<p>
Throws if <code>sd</code> is invalid.
Throws if <code>sd</code> or <code>rm</code> is invalid.
</p>
<pre>
x = 45.6
Expand Down

0 comments on commit e8a74a3

Please sign in to comment.