I'm having some trouble with a calculation with PHP. It would be really helpful if someone could check my code for me!

It isn't anything too difficult: I just need to update an average number. I know the new number, the current average number and the total number of records. What I'm using is the below:

$new_average_number=((($average_number*$total_records)+$this number)/$total_records);

Have I made any errors with this calculation, or should I be doing it a different way?

Thanks for any help