13
620hun
7y

Why am I getting 440.00000000000006 instead of 440 from a PositiveIntegerField? 😲

Comments
  • 0
    The beauty of python's stdout.
  • 1
    Basic integer nature
  • 3
    Are there floats in the background?
  • 1
    @Hedgepig yeah, but it gets saved to an integer db field in postgres. This only happens when I send the value in AJAX, the template renders to HTML properly. Who knows. I'll just put it in int().
  • 4
    *my best hick accent*
    Y’all don’t know pain ‘till you done used pascal Real Numbers.
Add Comment