I have the expression below to calculate a percentage;
mul(div(float(Actual),float(Budget)),float('100'))
This successfully returns a figure of 28.2
How can I round this number up or down? e.g if 2.8.2 round down to 28, or if 28.8 round up to 29.
The number varies, it's not always 28!
Can I not add the calculation into the formatNumber?
formatNumber(variables('varRound'),'#0')
formatNumber(variables(mul(div(float(Actual),float(Budget)),float('100'))),'#0')
Hello @jonboylib ,
please follow these steps:
1. Initialize a Float variable in which put your output (in my case, I've put manually a number):
2. Initialize a String variable putting the following expression:
formatNumber(variables('varRound'),'#0')
Here my output:
So, my number is rounded down, but the same logic is applied for rounding up.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional