Elgg  Version 6.3
number.php
Go to the documentation of this file.
1 <?php
11 if ((bool) elgg_extract('number_format', $vars, false)) {
12  $value = elgg_extract('value', $vars);
13  $decimals = (int) elgg_extract('decimals', $vars, 0);
14  if (is_numeric($value)) {
15  $value = elgg_number_format($value, $decimals);
16  }
17 }
18 
19 unset($vars['number_format']);
20 unset($vars['decimals']);
21 
22 echo elgg_view('output/text', $vars);
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:240
$value
Definition: generic.php:51
$vars['class']
Elgg number input Displays a number input field.
Definition: number.php:9
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
Definition: views.php:156
elgg_number_format(float $number, int $decimals=0)
Format a number with grouped thousands using language specific separators.
Definition: output.php:368