I'm calculating the age of a user by subtracting his age from today's date. The problem I have is that it show their age as whole number. But rather than showing it as a whole number, I'd like to display it as decimal like 25.5 or 27.3. I tried using round and number_format but neither worked.
$bday = $data->_field_data['node_field_data_field_game_players_nid']['entity']->field_player_birthday['und'][0]['value'];
$now = date("Y/m/d");
$diff = ($now) - date($bday);
echo number_format(round($diff, 2), 2);