Trying to Log MPL31152A2 to SD Card Shield

So I think I'm declaring a variable incorrectly (or something else completely wrong) in my sketch which is a mix of several sketches.
All I want to record to the SD car shield from the MPL3115A2 is temperature (SCL PIN 5, SDA PIN 4).
The serial output is correct. Between 23.8 *C and 24 *C.
But when I open the log file what I see is 25 and 24 until the time I stop the logging. No decimal or anything (I only care of 1 decimal point). It actually doesn't seem be rounding up either. Just a series of 25 and 24.
Thanking anyone with the patience to review the sketch!
The sketch follows (I have done away with comments to shorten it):
#include <SD.h>
#include <Wire.h>
#include <Adafruit_MPL3115A2.h>

Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();

const int chipSelect = 10;

float dataString = 0.0;

void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
// output, even if you don't use it:
pinMode(10, OUTPUT);
delay(2000);

if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
return;
}
Serial.println("card initialized.");

delay(2000);

if (SD.exists("datalog.txt"))//if the datalog.txt file is already on the disk
{
SD.remove("datalog.txt");//delete it. This prevents that the data is appended to an already existing file.
}

}

void loop()
{ if (! baro.begin()) {
Serial.println("Couldnt find sensor");
return;
}

{
// make a string for assembling the data to log:
String dataString = "";

{
int analogPin = 5;
int sensor = analogRead(analogPin);
dataString += String(sensor);
{
dataString += ",";
}
}

File dataFile = SD.open("datalog.txt", FILE_WRITE);

if (dataFile) {
dataFile.println(dataString);
dataFile.close();

float tempC = baro.getTemperature();
Serial.print(tempC,1); Serial.println("*C");
//Serial.println(dataString);
delay(5000);
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
}
}

Code tags would help!

Pretty printed:

void loop()
{ if (! baro.begin()) {
        Serial.println("Couldnt find sensor");
        return;
    }
    
    {
        // make a string for assembling the data to log:
        String dataString = "";
        
        {
            int analogPin = 5;
            int sensor = analogRead(analogPin);
            dataString += String(sensor);
            {
                dataString += ",";
            }
        }
        
        File dataFile = SD.open("datalog.txt", FILE_WRITE);
        
        if (dataFile) {
            dataFile.println(dataString);
            dataFile.close();
            
            float tempC = baro.getTemperature();
            Serial.print(tempC,1); Serial.println("*C");
            //Serial.println(dataString);
            delay(5000);
        }
        // if the file isn't open, pop up an error:
        else {
            Serial.println("error opening datalog.txt");
        }
    }
}

You are reading two values there. The one you print to serial is:

float tempC = baro.getTemperature();

That's the correct way of getting the temperature from that thing.

But the one you write to file is this:

int sensor = analogRead(analogPin);

and you can't read that sensor like that (I don't think the value you get has any connection to temperature actually).

To print the float to file convert it to a String first:

String tempString = String(tempC, 2); // 2 is how many decimal places you want
dataFile.println(tempString);