I am using a pulse output water flow sensor.

This sketch shows totalMiliLitre as an integer

I divide that by 1000 to get totalLitre, which is a float but I only get an integer with decimal places of 00

here is my output, sketch at the end.

Rate: 0.00L/min Total 1098 mL 1.00 L Rate: 0.00L/min Total 1098 mL 1.00 L Rate: 13.10L/min Total 1316 mL 1.00 L Rate: 12.88L/min Total 1530 mL 1.00 L Rate: 10.43L/min Total 1703 mL 1.00 L Rate: 9.99L/min Total 1869 mL 1.00 L Rate: 9.77L/min Total 2031 mL 2.00 L Rate: 9.99L/min Total 2197 mL 2.00 L Rate: 10.21L/min Total 2367 mL 2.00 L Rate: 9.77L/min Total 2529 mL 2.00 L Rate: 9.99L/min Total 2695 mL 2.00 L Rate: 7.77L/min Total 2824 mL 2.00 L

```
byte statusLed = 13;
byte sensorInterrupt = 0; // 0 = digital pin 2
byte sensorPin = 2;
float calibrationFactor = 4.5;
volatile byte pulseCount;
float flowRate;
// unsigned int flowMilliLitres;
float flowMilliLitres;
unsigned long totalMilliLitres;
//float totalLitres;
unsigned long oldTime;
void setup()
{
Serial.begin(57600);
pinMode(statusLed, OUTPUT);
digitalWrite(statusLed, HIGH); // We have an active-low LED attached
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
pulseCount = 0;
flowRate = 0.0;
flowMilliLitres = 0;
totalMilliLitres = 0;
oldTime = 0;
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}
void loop() // ++++++++++++++++++++++++++++++++++++++++++++++++++ VOID LOOP
{
if((millis() - oldTime) > 1000) // Only process counters once per second
{
detachInterrupt(sensorInterrupt);
flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / calibrationFactor;
oldTime = millis();
flowMilliLitres = (flowRate / 60) * 1000 ; // to get mLph
totalMilliLitres += flowMilliLitres;
float totalLitres = totalMilliLitres / 1000 ;
unsigned int frac;
Serial.print("Rate: ");
Serial.print(flowRate); Serial.print("L/min");
Serial.print(" Total "); // Output separator
Serial.print(totalMilliLitres); Serial.print(" mL ");
Serial.print(totalLitres); Serial.println(" L");
pulseCount = 0;
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}
}
void pulseCounter()
{
pulseCount++;
}
```