Hi @John_DeLeeuw ,
By default, the tooltip only supports simple HTML tags that outlined here - Supported HTML Subset | Qt GUI 5.15.8 so javascript is not working there.
To use javascript, you'll need to either include a <img> or <iframe> tag in the script so that full HTML support is activated. For instance, here's a trick to display area with 2 decimal places.

If only simple text is needed and the assets are imported, the conversion of tooltip can actually being done in import script in Data Source Configuration as well, for instance, here's how to set the tooltip of roads to the max speed with 2 decimal places
