Ticket #3176: docs.templates.txt.patch

File docs.templates.txt.patch, 1.3 KB (added by Eric Floehr <eric@…>, 18 years ago)

Patch to docs to document new functionality of floatformat

  • docs/templates.txt

     
    924924floatformat
    925925~~~~~~~~~~~
    926926
    927 Rounds a floating-point number to one decimal place -- but only if there's a
    928 decimal part to be displayed. For example:
     927When used without an argument, rounds a floating-point number to one decimal
     928place -- but only if there's a decimal part to be displayed. For example:
    929929
    930930    * ``36.123`` gets converted to ``36.1``
    931931    * ``36.15`` gets converted to ``36.2``
    932932    * ``36`` gets converted to ``36``
    933933
     934If used with a numeric integer argument, always rounds a number to that many
     935decimal places.  For example:
     936
     937    * ``36.1234`` with floatformat:3 gets converted to ``36.123``
     938    * ``36`` with floatformat:4 gets converted to ``36.0000``
     939
     940If the argument passed to floatformat is negative, it will round a number to
     941that many decimal places -- but only if there's a decimal part to be displayed.
     942For example:
     943
     944    * ``36.1234`` with floatformat:-3 gets converted to ``36.123``
     945    * ``36`` with floatformat:-4 gets converted to ``36``
     946
     947Using floatformat with no argument is equivalent to using floatformat with an
     948argument of ``-1``.
     949
    934950get_digit
    935951~~~~~~~~~
    936952
Back to Top