Read sensor and convert reading to const char*
The function dtostrf() is prototyped as:

char *dtostrf (double          val,
               signed char     width,
               unsigned char   prec,
               char           *sout);

Where:    
   val      Your float variable;
   width    Length of the string that will be created INCLUDING decimal point;
   prec     Number of digits after the deimal point to print;
   sout     Destination of output buffer;


An example of usage is as follows:

/* OPTION ONE */

    char msgBuffer[20];           // make sure this is big enough to hold your string
    char *pointer_to_created_string;

    float testFloat = 123.45;

    pointer_to_created_string = dtostrf(testFloat, 6, 2, msgBuffer);
    client.Publish("...topic...", pointer_to_created_string);

/* OPTION TWO */

    char msgBuffer[20];           // make sure this is big enough to hold your string

    float testFloat = 123.45;

    client.Publish("...topic...", dtostrf(testFloat, 6, 2, msgBuffer));


Don't be put off by the code in the link you included in your question. The first argument sent to dtostrf (everything before the first comma) is nothing more than a some calculations bundled into one single line.