Toggle Gauge Name conditional on 'value'

The Energy Dashboard ‘Net Energy Usage’ card title changes between ‘Net returned to the grid’ and ‘Net consumed from the grid’ depending on the calculated value.

How do I toggle the name in a custom Import/Export gauge to display display only Import or Export depending on whether the calculated value is positive or negative?