Skip to content

Show selection statistics with full double precision - #4222

Open
deepsidhu1313 wants to merge 1 commit into
sqlitebrowser:masterfrom
deepsidhu1313:fix/selection-sum-precision
Open

deepsidhu1313 wants to merge 1 commit into
sqlitebrowser:masterfrom
deepsidhu1313:fix/selection-sum-precision

Conversation

@deepsidhu1313

Copy link
Copy Markdown
Contributor

The Sum, Average, Min and Max values shown in the status bar of the Browse
Data tab were formatted with QString::arg(double), which only uses 6
significant digits. Larger values were therefore rounded, e.g. 1234567.89
was shown as 1.23457e+06. Format them with 15 significant digits instead,
which shows doubles accurately without exposing binary rounding noise.

Fixes #4033

The Sum, Average, Min and Max values shown in the status bar of the Browse
Data tab were formatted with QString::arg(double), which only uses 6
significant digits. Larger values were therefore rounded, e.g. 1234567.89
was shown as 1.23457e+06. Format them with 15 significant digits instead,
which shows doubles accurately without exposing binary rounding noise.

Fixes sqlitebrowser#4033
@mgrojo

mgrojo commented Oct 18, 2026

Copy link
Copy Markdown
Member

I guess the real problem behind #4033 was using a floating-point type for an amount of money. That is always going to cause problems, even if we increase the precission. In any case, I suppose this won't cause any harm, unless we don't like to have so much precission for the average, even for integer data:

imagen

What others think about this?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect Sum reporting at the bottom of Browse Data tab status bar

3 participants