pissang commented on a change in pull request #16286:
URL: https://github.com/apache/echarts/pull/16286#discussion_r775404396
##########
File path: src/util/number.ts
##########
@@ -138,7 +138,7 @@ export function round(x: number | string, precision:
number, returnStr: false):
export function round(x: number | string, precision: number, returnStr: true):
string;
export function round(x: number | string, precision?: number, returnStr?:
boolean): string | number {
if (precision == null) {
- precision = 10;
+ precision = ROUND_SUPPORTED_PRECISION_MAX;
Review comment:
`ROUND_SUPPORTED_PRECISION_MAX` is a safe protection for `toFixed`
methods. The actual precision issue in the JS engine is less than this.
Check this in your console
```ts
(0.1 + 0.2).toFixed(20);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]