Skip to content

Percentage number formatting in table not working on very small numbers in 5.0.0 #36189

@rea725

Description

@rea725

Bug description

Percentage formatting for very small numbers is not applied. The result of attempts to format very small numbers as percentages is that no format is applied and the raw number is returned.

It seems what triggers this is a case in which some of the numbers are very small, but non-zero. If so, all formatting breaks for the column and even larger numbers are not formatted correctly.

E.g.
-0.00001229 with D3 format .8% and Small number format .8% will just return the raw value. -0.00001229.

Image

It doesn't matter what percentage format is applied. It fails if the attempted format is .4% or .2% as well.

Here's a link to the Slack conversation I had about this with the AI bots:
https://apache-superset.slack.com/archives/C072KSLBTC1/p1763566767804459

There is mention of similar issues with number/currency formatting but nothing relating to percentage formatting specifically.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions