Skip to content

Commit b574453

Browse files
authored
typo fixed and minimal opinionated improvement
1 parent 2b5ac97 commit b574453

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ There are several built-in functions for rounding:
122122
: Rounds up: `3.1` becomes `4`, and `-1.1` becomes `-1`.
123123

124124
`Math.round`
125-
: Rounds to the nearest integer: `3.1` becomes `3`, `3.6` becomes `4` and `-1.1` becomes `-1`.
125+
: Rounds to the nearest integer: `3.1` becomes `3`, `3.5` becomes `4` and `-1.1` becomes `-1`.
126126

127127
`Math.trunc` (not supported by Internet Explorer)
128128
: Removes anything after the decimal point without rounding: `3.1` becomes `3`, `-1.1` becomes `-1`.
@@ -201,7 +201,7 @@ Strange! What is it then if not `0.3`?
201201
alert( 0.1 + 0.2 ); // 0.30000000000000004
202202
```
203203

204-
Ouch! There are more consequences than an incorrect comparison here. Imagine you're making an e-shopping site and the visitor puts `$0.10` and `$0.20` goods into their chart. The order total will be `$0.30000000000000004`. That would surprise anyone.
204+
Ouch! There are more consequences than an incorrect comparison here. Imagine you're making an e-shopping site and the visitor puts `$0.10` and `$0.20` goods into their cart. The order total will be `$0.30000000000000004`. That would surprise anyone.
205205

206206
But why does this happen?
207207

0 commit comments

Comments
 (0)