I am trying to format the value with percent pipe in html(Angular2) and i need the percentage value without % sign
Is there any way to use Angular percent pipe without sign?
Asked Answered
Multiply with 100, use decimal pipe. –
Delphine
Did you figure this out? As a clarification, I came across this when I use the percent pipe to format my value in the field. So the "input" is 97 (for 97%) for example. Before sending the value in the pipe, I divide by 100. All displays well. But when I change the value, if I leave the % in the input, out comes the value 96%, and not just 96. As I try to cast to Number in my Typescript, I get problems. I'm looking for a "percent pipe reversal" ? –
Excommunicatory
As @Amadan commented in your question, you can use number
pipe instead of percent
pipe and multiply your value by 100. Like this:
{{ value * 100 | number }}
See this DEMO sample
© 2022 - 2024 — McMap. All rights reserved.