<?php declare(strict_types=1); // two decimals with default grouping echo number_format(1234567.891, 2), "\n"; // custom decimal and thousands separators echo number_format(1234567.891, 0, ".", " "), "\n";
number_format groups and rounds