First thing. That code won't compile or auto format. Too many right curly braces.
When it works you appear to have a value returned by the concentration function. Is that what you want to turn into a percentage ? If so, what is it a percentage of ? What is your problem in turning the value into a percentage and displaying it ?
Why all the messing around converting a float to a string ?
For the complilation it was no problem.
The value returned by the concentration function,i s that what i want to turn into a percentage.
For the percentage i want, i will make some mixture with HIGH and LOW concentartion of alcohol than transform the result according these concentartion to a %.
My problem is turning the value in percentage and displaying it.
LCD display a string for this reason i convert the result from float to a string.
when i use lcd.print() i receive ovf a lot of time
for the percent i want the result will be converted in % like 5% 6% ... not in number like 556585472200,00 it's very long number without any signification.
when i use lcd.print() i receive ovf a lot of time
What does that mean ? What do you get if you Serial.print(x) ?
for the percent i want the result will be converted in % like 5% 6% ... not in number like 556585472200,00 it's very long number without any signification.
I don't feel that we are getting anywhere with what you mean by a percentage. The number that you quote makes no sense whatsoever.
What exactly are you getting? Because it looks like you have an array of data, and you want to make that array into an actual number.
If that is so, then take that array and put it into atoi() , also no need for [ ], just have "int number = atoi(Array);"
Another thing, it looks like you want a floating number, x.xx%, I think the Arduino IDE now has atof()... I think.
when i use lcd.print() i receive ovf a lot of time
That means OVerFlow.
The value is too big to print as the standard print algorithm uses unsigned longs to handle float.
So although a float can be 1E-38 .. 1E38 you can only print it between 1E-38 (given enough digits) and 4E9
this is a float that cannot be printed as it is bigger that MAXLONG.
Question I have which number is 100%?
Percentage is a relative number x is so much %% of y e.g. 20 = 4 % of 500
to convert a float into % you may divide it by the number that represents 1% (in my example 1% is 5)