Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit795fb29

Browse files
authored
toFixed
1 parentd9fb768 commit795fb29

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
|40|[pay attention when using every](#pay-attention-when-using-every)|
4747
|41|[How to convert an array of key-value tuples into an object](#How-to-convert-an-array-of-key-value-tuples-into-an-object)|
4848
|42|[Native text to speech JS](#Native-text-to-speech-JS)|
49-
50-
49+
|42|[Native text to speech JS](#Native-text-to-speech-JS)|
5150

5251

5352

@@ -924,4 +923,19 @@ const startSpeaking=()=>{
924923
}
925924
926925
926+
```
927+
928+
**[⬆ Back to Top](#table-of-contents)**
929+
### toFixed()
930+
931+
Warning: Floating point numbers cannot represent all decimals precisely in binary. This can lead to unexpected results, such as 0.1 + 0.2 === 0.3 returning false .
932+
933+
```javascript
934+
935+
123.678.toFixed() // Returns '124'
936+
123.678.toFixed(1) // Returns '123.7': Note rounding
937+
938+
2.35.toFixed(1) // Returns '2.4'. Note it rounds up
939+
2.65.toFixed(1) // Returns '2.6'. Note it rounds down -why??? see the warning above
940+
927941
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp