Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django-mathfilters

{% load mathfilters %}

...

<h1>Basic math filters</h1>

<ul>
    <li>8 + 3 = {{ 8|add:3 }}</li>

    <li>13 - 17 = {{ 13|sub:17 }}</li>

    {% with answer=42 %}
    <li>42 * 0.5 = {{ answer|mul:0.5 }}</li>
    {% endwith %}

    {% with numerator=12 denominator=3 %}
    <li>12 / 3 = {{ numerator|div:denominator }}</li>
    {% endwith %}

    <li>|-13| = {{ -13|abs }}</li>
</ul>
Comment

PREVIOUS NEXT
Code Example
Python :: change the number in 3rd line to get factorial for the number you want. Ex: num = 30 
Python :: how to make a numpy array of certain values 
Python :: how to get table schema sql pyodbc 
Python :: get file parent directory python 
Python :: flask docs 
Python :: how to rename files python 
Python :: windows how to store filepath as variabley python 
Python :: bitwise operators python 
Python :: Reverse an string Using Stack in Python 
Python :: read ms word with python 
Python :: line plotly with shaded area 
Python :: sort dictionary by key 
Python :: py string in list 
Python :: python get last element of array 
Python :: sklearn random forest 
Python :: pandas correlation matrix between one column and all others 
Python :: python pandas return column name of a specific column 
Python :: code coverage pytest as html 
Python :: url_for 
Python :: swapping in python 
Python :: how to install python library 
Python :: python code for extracting data from pdf 
Python :: how to declare global variable in python 
Python :: virtual env pyhton 
Python :: python includes string 
Python :: batch gradient descent 
Python :: cv2 opencv-python imshow while loop 
Python :: pyhton map 
Python :: pandas count number of repetitions of each diferent value 
Python :: python requests post form data 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =