[DEV] correction of the .000000 of double
This commit is contained in:
parent
4fb6bcebac
commit
2ad4975a45
@ -162,6 +162,21 @@ etk::UString::UString(const double _inputData)
|
|||||||
char tmpVal[256];
|
char tmpVal[256];
|
||||||
// generate the UString :
|
// generate the UString :
|
||||||
sprintf(tmpVal, "%lf", _inputData);
|
sprintf(tmpVal, "%lf", _inputData);
|
||||||
|
int32_t len=strlen(tmpVal);
|
||||||
|
if (NULL!=strchr(tmpVal, '.')) {
|
||||||
|
//have a '.'
|
||||||
|
// remove the .000000000 at the end of the string
|
||||||
|
for (int32_t iii=len-1; iii>=0 ; --iii) {
|
||||||
|
if (tmpVal[iii] == '0') {
|
||||||
|
tmpVal[iii] = '\0';
|
||||||
|
} else {
|
||||||
|
if (tmpVal[iii] == '.') {
|
||||||
|
tmpVal[iii] = '\0';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// set the internal data :
|
// set the internal data :
|
||||||
Set(tmpVal);
|
Set(tmpVal);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user