6

I am trying to format the value with percent pipe in html(Angular2) and i need the percentage value without % sign

  • 1
    Multiply with 100, use decimal pipe. – Amadan Jan 09 '19 at 07:54
  • 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" ? – Sébastien Richer Jul 04 '19 at 19:14

1 Answers1

1

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

benshabatnoam
  • 7,161
  • 1
  • 31
  • 52