Absolute value Javascript
Absolute value Javascript
Use Math.abs()
:
Math.abs(-30) // 30
Edit: It seems that your syntax is of django templates but you ask about javasscript. if thats the case use django mathfilters
Use Math.abs()
:
Math.abs(-30) // 30
Edit: It seems that your syntax is of django templates but you ask about javasscript. if thats the case use django mathfilters