0

I have a certain large float number 1.4088564e+12 and I have a calendar app that accepts events in milliseconds. That form of the float is obviously no good to me, I need to express it in its true form. Is there a way to do that?

The way I express it is simply

{{ class.attribute }}

The float is of course stored in a FloatField.

Firkamon
  • 807
  • 1
  • 9
  • 19
  • 1
    What you most lkely have is a UNIX timestamp. Convert it to datetime in your view to be displayed in the template. http://stackoverflow.com/questions/3682748/converting-unix-timestamp-string-to-readable-date-in-python – Mikko Ohtamaa Aug 11 '14 at 13:07
  • 1
    possible duplicate of [Format numbers in django templates](http://stackoverflow.com/questions/346467/format-numbers-in-django-templates) – Foon Aug 11 '14 at 13:48
  • 1
    If you don't want to do any math with those numbers, I think you should use a `CharField` instead of a `FloatField` or an `IntegerField`. – xyres Aug 11 '14 at 14:31

0 Answers0