I have one value, which describes current battery percentage. I want to be able to show value which will say for how long device can run with this battery percentage. So I need to be able to some function over data time series. Like:
battery_days_left = battery_percentage / (max(battery_percentage, 24h) - min(battery_percentage, 24h))
How can I implement such custom formula in any widget?
Thanks for help.