Skip to content

Commit e01998b

Browse files
committed
minor fixes
1 parent bbf60dd commit e01998b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/05-data-types/02-number/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ There are two ways to do so:
160160
```js run
161161
let num = 1.23456;
162162

163-
alert( Math.floor(num * 100) / 100 ); // 1.23456 -> 123.456 -> 123 -> 1.23
163+
alert( Math.round(num * 100) / 100 ); // 1.23456 -> 123.456 -> 123 -> 1.23
164164
```
165165

166166
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.

0 commit comments

Comments
 (0)