Hi,

I'd like to discuss reopening this wontfix'ed ticket: https://code.djangoproject.com/ticket/30761

The issue is that for values between 0 and -0.5, the floatformat filter returns "-0", whereas I think that most people would expect it to return "0".

The ticket was wontfix'ed because "this behavior is consistent with builtin round() and -0 exists in floating-point arithmetic".

Can I propose that in this case the better way to decide the result that it should produce is to ask what an ordinary person would expect to see, rather than what's consistent with a particular Python function?

When humans round -0.3 to the nearest whole number, we express the result as 0, not -0. Given that the point of template tags and filters is to make data more human-readable, I think returning "0" is preferable in this case than returning "-0".

If this ticket is reopened, I'll be happy to submit a patch for it.

Cheers,

Sky

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/aec9450abcb511a0bb4a020c770a0483%40skychristensen.com.

Reply via email to