How to keep doing something until certain float is = 0?

Being more specific, whithin the same frame. If you put a conditional like this: if (number > 0){number–;//in fact, it´s going to be more like an operation} That part will be done until the number reaches 0. However, it won´t be that until future frames, which I don´t want. Is there some way of doing an operation, and if the result of that operation isn´t 0, then repeat the operation? like return to the start of the conditional until reaches the goal within the same frame.

Yes. It’s called a while loop.

while (number > 0){number–;}

You can use a while loop with a flag like you suggested:
int flag = 10;
while (flag > 0)