From: Vadim Zeitlin Date: Sun, 13 Jul 2008 16:33:19 +0000 (+0000) Subject: use wxString::Format() instead of hardcoding floating point numbers string representa... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1bf55f4cda92e967786d54e4bc33fdb692e7f7fe use wxString::Format() instead of hardcoding floating point numbers string representation, this doesn't work in locales using decimal comma (#9714) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 814f3918a6..2cd20c56d4 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -336,14 +336,14 @@ GridFrame::GridFrame() grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't")); grid->SetColFormatFloat(6); - grid->SetCellValue(0, 6, _T("3.1415")); - grid->SetCellValue(1, 6, _T("1415")); - grid->SetCellValue(2, 6, _T("12345.67890")); + grid->SetCellValue(0, 6, wxString::Format(wxT("%g"), 3.1415)); + grid->SetCellValue(1, 6, wxString::Format(wxT("%g"), 1415.0)); + grid->SetCellValue(2, 6, wxString::Format(wxT("%g"), 12345.67890)); grid->SetColFormatFloat(7, 6, 2); - grid->SetCellValue(0, 7, _T("3.1415")); - grid->SetCellValue(1, 7, _T("1415")); - grid->SetCellValue(2, 7, _T("12345.67890")); + grid->SetCellValue(0, 7, wxString::Format(wxT("%g"), 3.1415)); + grid->SetCellValue(1, 7, wxString::Format(wxT("%g"), 1415.0)); + grid->SetCellValue(2, 7, wxString::Format(wxT("%g"), 12345.67890)); grid->SetColFormatNumber(8); grid->SetCellValue(0, 8, "17");