Reputation: 63
How can i generate this percentage: number * 100 ( ex. 0.050 * 100 = 5.5 ) i get the number from db like 0.050 but need to be showed as 5.5
actual code
<strong>{{d.AllowancePercentage}} %</strong>
Upvotes: 1
Views: 944
Reputation: 49
The simplest way I found is this:
{{ (d.AllowancePercentage * 100) | number:'1.1-2' }}
Here's the official documentation: https://angular.io/api/common/PercentPipe
Upvotes: 1