many thanks, didn't really think about that :)
it's not really the cleanest as it spawns new problems..
i have to round manually before converting to string - thats ok.
but then: i have no control over the decimal point in a string anymore..
and as i can get any sort of value e.g. -4,23 or even 1243,56 printf truncates the string after a given length irrespective of a sign or a large or small floor.
or am i missing something ?
EDIT:
i found a solution using the magic sprintf, i'll just post it in case someone else has a problem with the decimal separator, which is always a big hassle here...
string wobble(double x)
{
// take double, let sprintf round and replace period by comma
// return the string
int i =0;
char safe[16];
sprintf(safe,"%.2f",x);
for(i;i<16;i++)
{
if(safe[i] == '.')
safe[i] = ',';
if(safe[i] == '\0')
break;
}
return safe;
}