5

The following bindings:

{{ -50.52338914680037 }}
{{ -50.52338914680037 | number }}
{{ -50.52338914680037 | percent }}

Produce:

-50.52338914680037
-50.523
-5,052.339%

I would anticipate the output of the percent pipe to be

-50.523%

Is there something I'm missing?

1 Answers1

11

To get your anticipated result of -50.523% use this code:

{{ (-50.52338914680037 / 100) | percent }}

or

{{ -0.5052338914680037 | percent:'2.0-3' }}

Have a look at the DecimalPipe (API) for format adjustments if needed.

Lars
  • 2,315
  • 2
  • 24
  • 29
  • Well that's the default format anyway yeah? At any rate, even with it specified it, I get the same result: -5, 052.339%. –  Feb 17 '17 at 20:56
  • 1
    Oh geez...Yep sorry, can't believe I've missed that. –  Feb 19 '17 at 19:08