ngotl
08-15-2002, 02:09 PM
Hi, i have a float value needed to be stored into database. i guess i cannot use the type dw for the field so i try to convert the float value into string and store it. But when i call FLOATTOWSTR function, it doesnot return the same string as the value of the float variable. Here is my code:
AECHAR* temp;
double x;
temp = (AECHAR*)MALLOC(sizeof(AECHAR*) * 8); // my floating
point has at most 6 digits
if(temp == NUL)
return FALSE;
if(FLOATTOWSTR(x, temp, sizeof(AECHAR*) * 8) == FALSE)
return FALSE;
Now, if x == 10.12, then the string temp should be "10.12" but it is not. when i called string compare function to compare with a wide string "10.12", the result is not equal. I thought it shuold be very straigt forward since it's just a call to a function. Am i missing some tiny thing here? Thanks for any suggestion.
Luong
AECHAR* temp;
double x;
temp = (AECHAR*)MALLOC(sizeof(AECHAR*) * 8); // my floating
point has at most 6 digits
if(temp == NUL)
return FALSE;
if(FLOATTOWSTR(x, temp, sizeof(AECHAR*) * 8) == FALSE)
return FALSE;
Now, if x == 10.12, then the string temp should be "10.12" but it is not. when i called string compare function to compare with a wide string "10.12", the result is not equal. I thought it shuold be very straigt forward since it's just a call to a function. Am i missing some tiny thing here? Thanks for any suggestion.
Luong