0

I'm trying to get precise division with Python without success.

104101/2 gives 52050 whereas I need 52050.5

I also tried "%0.2f" % (104101/2) which is giving me '52050.00'.

Javascript equivalent works. Any idea what's wrong with me?

Alper Turan
  • 1,220
  • 11
  • 24

1 Answers1

0

104101/2.0

104101/float(2)

Or use Python 3

Eric Levieil
  • 3,554
  • 2
  • 13
  • 18