bito-code-review[bot] commented on PR #43620:
URL: https://github.com/apache/superset/pull/43620#issuecomment-5461220730
<!-- Bito Reply -->
The promotion check logic currently uses the raw `scaledValue` (based on
`absValue`) to decide whether to increment the scale index. As you noted, this
can lead to premature unit promotion before rounding is applied. To ensure
consistent behavior, the promotion check should indeed use the value after
applying the configured rounding, as this aligns the promotion threshold with
the final displayed value.
**superset-frontend/packages/superset-ui-core/src/number-format/factories/createMemoryFormatter.ts**
```
let scaledValue = absValue / Math.pow(base, i);
if (scaledValue >= base && i < suffixes.length - 1) {
scaleIndex += 1;
i = Math.min(suffixes.length - 1, scaleIndex);
}
```
--
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]