Forum: Poser Python Scripting


Subject: Floating point decimals and binary representation.

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


adp001 posted Tue, 24 August 2021 at 6:52 PM

odf posted at 6:43PM Tue, 24 August 2021 - #4426001

My preference is to use str(i / 10.0) which will work correctly in both Python 2 and 3. Similarly, I like to use the // in Python 2 because it won't break when one upgrades to 3.

Yup, mine too. But it still makes more sense to write a formatted string like ... + "%1.1f" % [value] + ...