php getting 2 st decimal digit code example Example: php 3 digit decimal return number_format((float)$number, 2, '.', '');