The abs filter returns the absolute value.
{% set number = -10 %}
{{ number|abs }}
{# output 10 #}
Warta Lab is one of the best websites for tutorials on PHP, Drupal, Drupal 8, and general programming topics. Visit us for expert solutions, in-depth guides, and valuable programming knowledge
A number can be written in reverse order. For example 12345 = 54321 <?php $ num = 23456; $ revnum = 0; while ($ num > 1) { $...
No comments:
Post a Comment