dosubot[bot] commented on issue #36189:
URL: https://github.com/apache/superset/issues/36189#issuecomment-3553620098

   <!-- Answer -->
   There isn’t an existing ticket or documented fix for the percentage 
formatting bug with very small numbers in Superset 5.0.0/master. The formatting 
logic for table columns uses D3 format strings and is implemented in the 
frontend, specifically in the `formatValue.ts` and `transformProps.ts` files 
for the table chart plugin. For numeric columns, if the absolute value is less 
than 1, Superset tries to use a "small number formatter" (configured via 
`d3SmallNumberFormat`), but if this isn’t set up correctly or if the formatter 
fails, the raw value may be returned instead of a formatted percentage. This 
logic is delegated to the D3 formatter via the `NumberFormatterRegistry` and 
`createD3NumberFormatter` functions, which handle the actual formatting and 
locale settings 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts#L33-L80),
 [source](https://github.com/apache/superset/bl
 
ob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts#L60-L753),
 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-core/src/number-format/NumberFormatterRegistry.ts#L27-L85).
   
   If you want to troubleshoot or patch this, check the configuration for 
`d3SmallNumberFormat` in your column settings and review how the formatter is 
applied for values less than 1. The bug likely occurs when the formatter fails 
to handle very small values, causing Superset to fall back to displaying the 
raw number.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/d15e4151-7997-4a9f-8ac7-8b0022741bd0?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36189)


-- 
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]

Reply via email to