I recently needed to truncate some IEEE 754 64bit floating point numbers to a given number of decimal places. I assumed Python would have built-in support for this. Not so.
Now there are reasons for this. The primary one being that you can’t really truncate floating point numbers. Now that being said – if you need to – I present here a good way to approximate the effect.