Skip to content

Commit

Permalink
Demonstrate the thousands separator in internat sample too
Browse files Browse the repository at this point in the history
Use a number > 1000 to show the difference between the locales.
  • Loading branch information
vadz committed Aug 20, 2021
1 parent e375b67 commit 1669d9b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions samples/internat/internat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,19 @@ MyFrame::MyFrame()

topSizer->Add(grid, wxSizerFlags().Center().Border());

// show the difference between wxString::Format() and wxNumberFormatter:
// the former uses the current C locale, while the latter uses the UI
// locale
// show the difference (in decimal and thousand separator, hence use a
// floating point number > 1000) between wxString::Format() and
// wxNumberFormatter: the former uses the current C locale, while the
// latter uses the UI locale
topSizer->Add(new wxStaticText
(
panel,
wxID_ANY,
wxString::Format
(
_("Number in UI locale: %s; in C locale: %.2f"),
wxNumberFormatter::ToString(5.67, 2),
5.67
wxNumberFormatter::ToString(1234567.89, 2),
1234567.89
)
),
wxSizerFlags().Center().Border());
Expand Down

0 comments on commit 1669d9b

Please sign in to comment.