How to change font color negative number , positive number data from json with handlebars?

I have get json data from external api.

<h4>ChangePercent <span class="badge bg-secondary"> {{ stock.changePercent}} % </span></h4>

Code above is get response data json and it’s return with number type, and use template engine with express handlebars to render. It’s work , But.. I want to change font color red if stock.changePercent < 0 , green for stock.changePercent > 0


You can conditionally render in handlebarsjs


<h4>ChangePercent <span class="badge bg-secondary" {{#if stockChangeSmallerThanZero}}style="color: red;"{{/if}}>  {{ stock.changePercent}} %    </span></h4> 


  stockChangeSmallerThanZero: true,

Online playground: