mirror of
https://github.com/glest/glest-source.git
synced 2025-08-15 12:54:01 +02:00
- fixed keyboard bug where - was thought to be numeric
This commit is contained in:
@@ -136,16 +136,19 @@ string doubleToStr(double d,int precsion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsNumeric(const char *p, bool allowNegative) {
|
bool IsNumeric(const char *p, bool allowNegative) {
|
||||||
int index = 0;
|
if(p != NULL && strcmp(p,"-") == 0) {
|
||||||
for ( ; *p; p++) {
|
return false;
|
||||||
if (*p < '0' || *p > '9') {
|
}
|
||||||
if(allowNegative == false || (*p != '-' && index == 0)) {
|
int index = 0;
|
||||||
return false;
|
for ( ; *p; p++) {
|
||||||
}
|
if (*p < '0' || *p > '9') {
|
||||||
|
if(allowNegative == false || (*p != '-' && index == 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
}
|
}
|
||||||
index++;
|
return true;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Comma: public numpunct<char>// own facet class
|
class Comma: public numpunct<char>// own facet class
|
||||||
|
Reference in New Issue
Block a user