HLA bubble text doesn't display zero (0) value?

Okay, I think I may have found a workaround:

        # Workaround to display zero value
        if self.scaled_position == 0:
            self.scaled_position = '0'

… based on a StackOverflow article about rendering zero using a mustache template.

The only side-effect for my extension that I noticed, is that the CSV export added quotes around the zero. However, I’m not familiar with internal python type/conversion behavior, and if this workaround might have undesired consequences for other extensions that actually want to keep/use the integer value internally vs. just convert it to a string to output it to an AnalyzerFrame and display it within the bubble text.

Here is an example of the side-effect to the CSV exported text, was (output is 0 as though zero is an integer value):

name,type,start_time,duration,"position","rate","scaled_position","scaled_rate"
  :
"Quadrature Encoder","QuadEncoder",0.2482546,7.6912e-05,0,12553.35174491749,0,25106.70348983498
  :
"Quadrature Encoder","QuadEncoder",0.40034152,0.000109412,0,8738.50886084273,0,17477.01772168546
  :

Now (output is “0” as though zero is a text/string value):

name,type,start_time,duration,"position","rate","scaled_position","scaled_rate"
  :
"Quadrature Encoder","QuadEncoder",0.2482546,7.6912e-05,0,12553.35174491749,"0",25106.70348983498
  :
"Quadrature Encoder","QuadEncoder",0.40034152,0.000109412,0,8738.50886084273,"0",17477.01772168546
  :

So, is the ‘Template Engine’ being used to format & render the bubble text based on Handlebars JS derived from Mustache, or is it something else?

Trying to answer that question, I did a different workaround that might be preferred (and seems to indicate that the ‘Template Engine’ is Handlebars JS or some other derivative):

    result_types = {
        'QuadEncoder': {
            # Workaround to output '0' rather than empty string ('') for zero (a 'falsy' value in python)
            'format': '{{#if data.scaled_position}}{{data.scaled_position}}{{else}}0{{/if}}'
        }

The pattern is a bit ugly, but at least you don’t need to modify the source object, just handle the special case of a falsy value in python (see StackOverflow article on truthy and falsy for good list of other python values that may need this trick to get an integer zero output in bubble text vs. an empty string).