Is your feature request related to a problem? Please describe.
I really like the Charging Stats Dashboard but as my home charging has reached over 1 MWh it is only displayed as 1 MWh which is a bit low resolution to be really useful compared to the other that has kWh displayed.
Describe the solution you'd like
Best case solution would be if it is possible to get MWh to display with 3 decimals while kWh still displays with 0 decimals
Describe alternatives you've considered
Is it possible to force Grafana to only display as kWh even when total charged amount passes 1 MWh?
Additional context
Current look:

With 3 decimals. Good for MWh but looks bad for kWh

In the mean time @SigLinJo, you can:


@adriankumpf this is a basic change, but I could do a pull request if you want? Also never done one, so that would be exciting.
As you can see in my original post I did change it to 3 decimals but I think it looks a bit strange to display the kWh that way, only MWh needs to be changed to 3 decimals and that is outside my ability. But it is a good interim fix to actually be able to read out the amount charged when it goes above 1000 kWh :)
Ah. I apologize, I missed that. Thought that second image is the _desired_ state. 🤦🏽♂️
Another solution would be to fix it to kWh with a custom unit...


Another solution would be to fix it to kWh with a custom unit...
Could you build logic into the custom unit to convert it from kWh to MWh once it exceeds a value?
i don't think so
https://grafana.com/blog/2020/01/27/grafana-v6.6-released/#custom-data-units
@cwanja
No but you could do it in the SQL.
@SigLinJo Does this work?

If this works, I can put in a PR.
That looks very promising :) Thank you for looking into it! Just makes the M in MWh capital and it could be the solution we are looking for.
@SigLinJo good catch, I'll put in a PR, it's a simple change and I like it.
As soon as you do the PR I will test it :)
Tested! I'm really happy about this! Makes this dashboard much more useful! Feel free to close this as soon as it's merged :)
Most helpful comment
Another solution would be to fix it to kWh with a custom unit...