minor fixes
This commit is contained in:
parent
bbf60dd340
commit
e01998baf8
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ There are two ways to do so:
|
||||||
```js run
|
```js run
|
||||||
let num = 1.23456;
|
let num = 1.23456;
|
||||||
|
|
||||||
alert( Math.floor(num * 100) / 100 ); // 1.23456 -> 123.456 -> 123 -> 1.23
|
alert( Math.round(num * 100) / 100 ); // 1.23456 -> 123.456 -> 123 -> 1.23
|
||||||
```
|
```
|
||||||
|
|
||||||
2. The method [toFixed(n)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) rounds the number to `n` digits after the point and returns a string representation of the result.
|
2. The method [toFixed(n)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) rounds the number to `n` digits after the point and returns a string representation of the result.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue