For the second code, your if statements use '=' instead of '=='. Not sure if it's the cause of the warning but it probably will not do what you think it does.
For the first one, show what you have tried. What is wrong with dtostrf()? Why do you use String (with capital S)?