31 #include <wx/msw/private.h>
59 struct lconv *info = localeconv();
60 wxString s = info ? wxString::FromUTF8(info->decimal_point) : wxString(
".");
77 struct lconv *info = localeconv();
78 wxString s = info ? wxString::FromUTF8(info->thousands_sep) : wxString{};
105 wxT(
"Style_NoTrailingZeroes can't be used with integer values") );
107 wxT(
"Style_OneTrailingZero can't be used with integer values") );
109 wxT(
"Style_TwoTrailingZeroes can't be used with integer values") );
111 wxT(
"Style_ThreeTrailingZeroes can't be used with integer values") );
121#ifdef HAS_LONG_LONG_T_DIFFERENT_FROM_LONG
134 if ( precision == -1 )
149 if (val == std::numeric_limits<double>::infinity())
151 return _(
"Infinity");
155 return _(
"-Infinity");
158 wxString s = wxString::Format(
format, val);
163 if ( precision != -1 )
195 const size_t start = s.find_first_of(
wxT(
"0123456789"));
202 const size_t GROUP_LEN = 3;
204 while ( pos > start + GROUP_LEN )
207 s.insert(pos, thousandsSep);
215 wxString::Format(
wxT(
"No decimal separator in \"%s\""), s) );
216 wxCHECK_RET( posDecSep,
wxT(
"Can't start with decimal separator" ));
219 size_t posLastCharacterToKeep = s.find_last_not_of(
wxT(
"0"));
222 if ((posLastCharacterToKeep == posDecSep) && (retain == 0)) {
223 posLastCharacterToKeep--;
224 }
else if ((posLastCharacterToKeep - posDecSep) < retain) {
225 posLastCharacterToKeep = retain + posDecSep;
228 s.erase(posLastCharacterToKeep + 1);
241 s.Replace(wxString(thousandsSep), wxString());
248 return s.ToLong(val);
251#ifdef HAS_LONG_LONG_T_DIFFERENT_FROM_LONG
258 return s.ToLongLong(val);
268 return s.ToDouble(val);
constexpr size_t npos(-1)