Issue
I am displaying a number the following way:
{{product.weight}}
I would like to make it so if the number is positive it shows with a + sign.
I see documentation on something called NumberSymbol which is an enum but not sure how to properly use it with a pipe:
https://angular.io/api/common/NumberSymbol
Solution
Use this:
{{product.weight > 0 ? '+' + product.weight : product.weight}}
Answered By - mamichels
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.