Forum: Poser Python Scripting


Subject: Floating point decimals and binary representation.

structure opened this issue on Aug 24, 2021 ยท 17 posts


bagginsbill posted Tue, 24 August 2021 at 11:26 AM

I'm not using Python 12 - but I am using Python 3 because 2 is dead.

Anyway - yes if you're in Python 2 (Poser 11 or below) then division by 10 needs to be i / 10.0.

And yes you can format umpteen ways

f'{i / 10:.1f}'
'%.1f' % (i / 10.0)
str(i / 10.0)

You pick which way you're comfortable with. I usually pick based on the simplest syntax, or the shortest amount of coding, which generally means fewer mistakes.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)