php 2 decimal even if not exists code example Example: php 2 decimal even if not exists number_format((float)$number, 2, '.', '')