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

Viewed 79

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

1 Answers
Related