Progress bar with variable numbers

Hey guys, I’m trying to build a calorie calculator that takes the users daily calories and subtracts the users consumed calories to display an animated bar in my group of current calories remaining.

Currently when I put my user data into the progress bar its above 100, so when consumed calories are subtracted from it the bar stays full.

These sort of bars as an example.

Is there an equation or plugin that will achieve this?

As a side note I also need the data to automatically be saved to a log thats only relevent to the user at midnight, so it resets the next day, any idea’s the best way to do this?

Thank you all for the help!

Sean