From e8a74a38e889aad08e6a9afe8d0338b78e8466f7 Mon Sep 17 00:00:00 2001 From: nutboltu Date: Mon, 24 Aug 2020 13:30:02 +1000 Subject: [PATCH] doc: update toExponential, toFixed and toPrecision docs with rm mode --- doc/bigAPI.html | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/doc/bigAPI.html b/doc/bigAPI.html index e1a8dbd..67035f5 100644 --- a/doc/bigAPI.html +++ b/doc/bigAPI.html @@ -656,10 +656,14 @@
- toExponential.toExponential(dp) ⇒ + toExponential.toExponential(dp, rm) ⇒ string
-

dp? : number : integer, 0 to 1e+6 inclusive

+

+ dp? : number : integer, 0 to 1e+6 inclusive +
+ rm? : number : 0, 1, 2 or 3 +

Returns a string representing the value of this Big number in exponential notation to a fixed number of dp decimal places. @@ -668,7 +672,7 @@

If the value of this Big number in exponential notation has more digits to the right of the decimal point than is specified by dp, the return value will be rounded to dp decimal places using - rounding mode Big.RM. + rounding mode rm.

If the value of this Big number in exponential notation has fewer digits @@ -678,10 +682,12 @@

If dp 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.
+ if rm is omitted or is undefined, the current + Big.RM setting is used.

- Throws if dp is invalid. + Throws if dp or rm is invalid.

 x = 45.6
@@ -698,11 +704,13 @@ 
- toFixed.toFixed(dp) ⇒ + toFixed.toFixed(dp, rm) ⇒ string

dp? : number : integer, 0 to 1e+6 inclusive +
+ rm? : number : 0, 1, 2 or 3

Returns a string representing the value of this Big number in normal @@ -712,7 +720,7 @@

If the value of this Big number in normal notation has more digits to the right of the decimal point than is specified by dp, the return value will be rounded to dp decimal places using - rounding mode Big.RM. + rounding mode rm.

If the value of this Big number in normal notation has fewer fraction @@ -728,10 +736,12 @@

If dp is omitted or is undefined, the return value is simply the value in normal notation. This is also unlike Number.prototype.toFixed, which returns the value to zero - decimal places. + decimal places.
+ if rm is omitted or is undefined, the current + Big.RM setting is used.

- Throws if dp is invalid. + Throws if dp or rm is invalid.

 x = 45.6
@@ -745,10 +755,14 @@ 
- toPrecision.toPrecision(sd) ⇒ + toPrecision.toPrecision(sd, rm) ⇒ string
-

sd? : number : integer, 1 to 1e+6 inclusive

+

+ sd? : number : integer, 1 to 1e+6 inclusive +
+ rm? : number : 0, 1, 2 or 3 +

Returns a string representing the value of this Big number to the specified number of sd significant digits. @@ -757,7 +771,7 @@

If the value of this Big number has more digits than is specified by sd, the return value will be rounded to sd significant digits using rounding mode - Big.RM. + rm.

If the value of this Big number has fewer digits than is specified by @@ -770,10 +784,12 @@

If sd is omitted or is undefined, the return value is - the same as .toString(). + the same as .toString().
+ if rm is omitted or is undefined, the current + Big.RM setting is used.

- Throws if sd is invalid. + Throws if sd or rm is invalid.

 x = 45.6