chakra-core / chakra-core/ChakraCore

ChakraCore rounds too nicely for `toFixed` and `toPrecision`

Open
#2,750 0 comments 0 reactions 0 assignees View on GitHub
Bug Severity: 2
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Input:

```js
1.1.toFixed(20);
1.1.toPrecision(21)
```

These should both output `"1.10000000000000008882"`, and do so in other engines. See the loop in step 8 of https://tc39.github.io/ecma262/#sec-number.prototype.tofixed -- The algorithm is different (simpler) than Number.prototype.toString.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.