# How to get the percentage of two counters without decimal ?

• 5th May 2018, 05:30 PM
MagnetoX
How to get the percentage of two counters without decimal ?
I need to find value „Counter” as a percentage of „ Counter 2” value. I’ve got three counters. Counter (my variable value) , Counter 2 ( This is my 100% value – it’s stable) , Counter 3 ( result in percentage ).

I used -> Set Counter to :

( value( "Counter" ) + 0.0 ) / ( value( "Counter 2" ) + 0.0 ) * 100

It works. But result is value with decimals. Is it possible to set „Counter 3” without decimalas (only full figures) ?
• 5th May 2018, 07:59 PM
1Ombra1
You can use the Floor function to rount it down
• 5th May 2018, 08:17 PM
moonyjacob
Wrap the entire expression with floor(value) :)
• 5th May 2018, 09:04 PM
MagnetoX
Thank you. It works.
• 7th May 2018, 12:25 AM
droberson
Do any of your counters ever go negative? Floor(value) could give you a problem.
Floor(-3.5) = -4 (moves away from zero)
Int(-3.5) = -3 (moves toward zero)

Does counter 2 ever go to 0 or 0.0? Could give you a divide-by-zero error
• 14th July 2019, 07:06 PM
RichC