# Floor operation in transformation

I want to rotate an object a bit every second for example. I thought of the mathematical floor operation. This operation seems to be implemented somewhat, as I can enter something like floor(10.1234) but I want something like this floor(#frame) which creates this error:

('unexpected EOF while parsing', ('<string>', 1, 13, 'floor(#frame)'))

• The ‘#’ is not part of the variable ‘frame’ but simply indicates that it’s a shorthand driver. You would have more luck with ‘#floor(frame)’ - although ‘frame’ is an integer and ‘floor’ would round down to the nearest integer so it doesn’t make sense as it is... presumably you need to include some other factor such as ‘#floor(float(frame)/25)’ to jump once every 25 frames...? – Rich Sedman Sep 15 at 17:06
• Thanks that solved the problem, obviously flooring a integer isn't useful... – user11914177 Sep 15 at 17:29

To use the floor function you should prefix the entire expression with '#' - ie, #floor(frame). In order to have the value step up by 1 on each 25th frame you could enter the expression #floor(float(frame)/25). This converts the 'frame' into a floating point value (technically not required - but still good practice), divides by 25 and rounds down to an integer. ie, on frames 0-24 it will produce 0, on frames 25-49 it will produce 1, 50-74 -> 2, 75-99 -> 3, etc.