public function testNumber() { $value = 1336811080.23; $format = []; $this->assertEquals('1 336 811 080,23', rex_formatter::number($value, $format)); $format = [5, ':', '`']; $this->assertEquals('1`336`811`080:23000', rex_formatter::number($value, $format)); }
/** * Returns the formatted time difference. * * @param int $precision Factor which will be multiplied, for convertion into different units (e.g. 1000 for milli,...) * @param int $decimals Number of decimals points * * @return string Formatted time difference */ public function getFormattedDelta($precision = self::MILLISEC, $decimals = 3) { $time = $this->getDelta($precision); return rex_formatter::number($time, [$decimals]); }