Twig abs filter

 The abs filter returns the absolute value.

{% set number = -10 %}

{{ number|abs }}

{# output 10 #}

No comments:

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...