asyncMqtt - converting an payload to an number

Im using asyncMqtt to subscribe to a payload (a temperature value) and I want to then print this number to a LCD screen. I can serial print the number but I'm unable to work out what code is needed to print the number to screen.
I was using a call back but it seems the asyncmqtt does not have the ability????

void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {
  Serial.println("Publish received.");
  Serial.print("  topic: ");
  Serial.println(topic);
  Serial.print("  qos: ");
  Serial.println(properties.qos);
  Serial.print("  dup: ");
  Serial.println(properties.dup);
  Serial.print("  retain: ");
  Serial.println(properties.retain);
  Serial.print("  len: ");
  Serial.println(len);
  Serial.print("  index: ");
  Serial.println(index);
  Serial.print("  total: ");
  Serial.println(total);
  Serial.print("  payload: ");
  Serial.println(payload); 

}

do you try lcd.print(payload) ?

yeah but not the answer as it will be text not a number. I need to work out how to change it to a number??

to which number?
to integer - use atoi() function
to float/double - atof()

sorry to ask but do you have any example code?

float temperature = atof (payload);

perhaps you should to add

#include <stdlib.h>

at the beginning of your sketch

that give an error cannot convert float to const char........

show your code

sorry had put the code in incorrectly, seems to be working better now. I have temperature as the value i need.
thanks

please mark the problem solved