Great thanks, got it working with mm^3. Yes it makes sense to abstract away the filament diameter ; but maybe it would be best to use another letter to avoid confusion? (V instead of E? for instance sailfish uses A/B for dual extruders, but I do not know whether there is any standard for this).
I also got the estimated time and material use in there, so that the diplay is correct - cool!
About the discrepancy in Cura: I had switched to a Reprap profile and used 1.75 mm, then back to Ultimaker 2. Cura probably continued to use 1.75 mm when estimating times. I did the same switch back and forth with 2.85 mm filament and now everything matches.
Thanks!