Don't show wrongly rounded value of π in the internat sample

We formatted the value with lesser precision than was used for
displaying it, resulting in unexpected display. Fix this by reducing the
number of digits used in the source (because they're lost anyhow when
formatting using the default precision) and the precision used when
displaying the number.

Closes #23192.
This commit is contained in:
Vadim Zeitlin 2023-02-14 23:23:17 +00:00
parent f12d35afe2
commit ec4ff44479

View file

@ -415,8 +415,8 @@ MyFrame::MyFrame()
grid->HideRowLabels();
grid->SetColLabelValue(0, _("Number"));
grid->SetColFormatFloat(0);
grid->SetCellValue(0, 0, wxNumberFormatter::ToString(3.14159265, -1));
grid->SetColFormatFloat(0, -1 /* width */, 5 /* we only use 5 digits below */);
grid->SetCellValue(0, 0, wxNumberFormatter::ToString(3.14159, -1));
grid->SetColLabelValue(1, _("Date"));
grid->SetColFormatDate(1);