Skip to content

Commit 5810376

Browse files
committed
v6.0.2
1 parent 20d9ba9 commit 5810376

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 6.0.2
2+
3+
* 31/10/20
4+
* #147 Change `toJSON` to be an alias of `toString`.
5+
16
#### 6.0.1
27

38
* 30/09/20

docs/index.html

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
<a class='nav-title' href="#">API</a>
5959
<select id="version" name="version" onchange="location.href=this.value;this.selectedIndex=0">
60-
<option value="" selected>v6.0.1</option>
60+
<option value="" selected>v6.0.x</option>
6161
<option value="legacy/v5.2.x.html">v5.2.x</option>
6262
<option value="legacy/v5.1.x.html">v5.1.x</option>
6363
<option value="legacy/v5.0.x.html">v5.0.x</option>
@@ -105,11 +105,11 @@
105105
<li><a href="#times" >times</a></li>
106106
<li><a href="#toE" >toExponential</a></li>
107107
<li><a href="#toF" >toFixed</a></li>
108+
<li><a href="#toJSON" >toJSON</a></li>
108109
<li><a href="#toN" >toNumber</a></li>
109110
<li><a href="#toP" >toPrecision</a></li>
110111
<li><a href="#toS" >toString</a></li>
111112
<li><a href="#valueOf">valueOf</a></li>
112-
<li><a href="#toJSON" >toJSON</a></li>
113113
</ul>
114114

115115
<a href="#instance-properties">Properties</a>
@@ -817,6 +817,21 @@ <h5 id="toF">
817817

818818

819819

820+
<h5 id="toJSON">
821+
toJSON<code class='inset'>.toJSON() <i>&rArr; string</i></code>
822+
</h5>
823+
<p>As <a href='#toS'><code>toString</code></a>.</p>
824+
<pre>
825+
x = new Big('177.7e+457')
826+
y = new Big(235.4325)
827+
z = new Big('0.0098074')
828+
str = JSON.stringify( [x, y, z] )
829+
830+
JSON.parse(str, function (k, v) { return k === '' ? v : new Big(v) })
831+
// Returns an array of three Big numbers.</pre>
832+
833+
834+
820835
<h5 id="toP">
821836
toPrecision<code class='inset'>.toPrecision(sd) &rArr;
822837
<i>string</i></code>
@@ -911,7 +926,8 @@ <h5 id="valueOf">
911926
valueOf<code class='inset'>.valueOf() <i>&rArr; string</i></code>
912927
</h5>
913928
<p>
914-
As <code>toString</code> except the minus sign is included for negative zero.
929+
As <a href='#toS'><code>toString</code></a> except the minus sign is
930+
included for negative zero.
915931
</p>
916932
<pre>
917933
x = new Big(-0)
@@ -925,24 +941,6 @@ <h5 id="valueOf">
925941

926942

927943

928-
<h5 id="toJSON">
929-
toJSON<code class='inset'>.toJSON() <i>&rArr; string</i></code>
930-
</h5>
931-
<p>
932-
Returns a string representing the value of this Big number in exponential
933-
notation. The minus sign is included for negative zero.
934-
</p>
935-
<pre>
936-
x = new Big('177.7e+457')
937-
y = new Big(235.4325)
938-
z = new Big('0.0098074')
939-
str = JSON.stringify( [x, y, z] )
940-
941-
JSON.parse(str, function (k, v) { return k === '' ? v : new Big(v) })
942-
// Returns an array of three Big numbers.</pre>
943-
944-
945-
946944
<h4 id="instance-properties">Properties</h4>
947945
<p>
948946
A Big number is an object with three properties:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "big.js",
33
"description": "A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic",
4-
"version": "6.0.1",
4+
"version": "6.0.2",
55
"keywords": [
66
"arbitrary",
77
"precision",

0 commit comments

Comments
 (0)