I am getting a value(for eg "75.8%") which is a string from am api and i want to use it as number so i can apply conditions
like this
<div
class="container"
[ngClass]="{
'pos' : value > 0,
'neg' : value < 0
}"
*ngIf="value"
>
<span class="me-1">
{{value}} %
</span>
</div>
Note:
Basically what i am doing is changing the background color to green (using class 'pos') if value is positive and to red if value is negative
I tried without converting the percent value as i dont know how to convert it