What flowmeter are you using?
Most will have a configurable pulse output that you can easily connect to a digital input on your PLC. Set it up on the meter for 1 pulse per m3. Use the input to trigger a counter. At midnight, move the counter accumulator into your "yesterday's total" and reset the counter.
I prefer this method as it leaves all the tricky math and rounding / accuracy issues up to the flowmeter manufacturer. They have teams of nerds for this.
I had one plant where after doing that they saw a 2% increase in totals - the analog was reading low. Doesn't sound like much but when you get paid per m3 and it's a million $ a year.. that's another sweet $20k to pay me bonuses with! (Yeah Right)