Difficulty putting parentheses around a negative number

I tried using this code to put parentheses around negative values of the variable lvTot5:

lvTot5 = ?(lvTot5<0,pattern(-lvTot5,"($#,)"), lvTot5>0,pattern(lvTot5,"$#,"),"")

but negative numbers lose the trailing parenthesis. I was forced to use this code:

lvTot5 = ?(lvTot5<0,pattern(-lvTot5,"($#,") + ")", lvTot5>0,pattern(lvTot5,"$#,"),"")

Can anybody replicate this problem?

Looks like a bug to me. I’ve added a bug report.

Also, off topic, but man to I hate the buggy new text editor in BitBucket.