put this function inside "Functions_and_var_management.ino" and
String DoubleToString(double d)
{
//Convert a double to string with 5 decimals and then removes the trailing zeros (and eventually the '.')
String z = String(d, 5);
char *p;
p = (char*) z.c_str()+ z.length() -1;
while (*p == '0')
{
*p-- = '\0';
}
if (*p == '.')
*p = '\0';
return z;
}
then replace each time you convert numbers to string with this function.
For example,
if (FunctionName == F("len")) MyOut = String(MyOut.length()); -===> if (FunctionName == F("len")) MyOut = DoubleToString(MyOut.length());
or
if (FunctionName == F("int"))
{
MyOut = String(Param0.toInt()); ===> MyOut = DoubleToString(Param0.toInt());
}
You need to repeat this to all the numerical functions.
This should fix the problem of the numbers displayed all the time with 2 decimals.
Regards,
CiccioCB
P.S. I'm actually working for a String parser :-;