- f = 0.0;
- if (! (c == wxT('.') || c == wxT(',') || c == wxT('-') || c == wxT('+') || isdigit(c)) )
- {
- m_input.Ungetch(c);
- return 0.0;
- }
-
- if (c == wxT('-'))
- {
- sign = -1;
- c = m_input.GetC();
- } else
- if (c == wxT('+'))
- {
- sign = 1;
- c = m_input.GetC();
- }
- else
- {
- sign = 1;
- }
-
- while (isdigit(c))
- {
- f = f*10 + (c - wxT('0'));
- c = m_input.GetC();
- }
-
- if (c == wxT('.') || c == wxT(','))
- {
- double f_multiplicator = (double) 0.1;
-
- c = m_input.GetC();
-
- while (isdigit(c))
- {
- f += (c-wxT('0'))*f_multiplicator;
- f_multiplicator /= 10;
- c = m_input.GetC();
- }
-
- if (c == wxT('e'))
- {
- double f_multiplicator = 0.0;
- int i, e;
-
- c = m_input.GetC();
-
- switch (c)
- {
- case wxT('-'): f_multiplicator = 0.1; break;
- case wxT('+'): f_multiplicator = 10.0; break;
- }
-
- e = Read8(); // why only max 256 ?
+ wxString word = ReadWord();
+ if(word.empty())
+ return 0;
+ return wxStrtol(word.c_str(), 0, base);
+}