Help Please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
larissahp
Forum Newbie
Posts: 1
Joined: Mon Oct 14, 2002 8:43 am

Help Please

Post by larissahp »

Okay, I am trying to write an online racing game (for horses) but I need help with the winning times. I get the winning time in seconds.

For example:
winning time = 54.2333333333

I was wondering if there was a function that would display the winning time as follows:
0:54.23

Thankx,
Larissa
User avatar
Phirus
Forum Commoner
Posts: 37
Joined: Thu Apr 18, 2002 4:10 pm
Contact:

Post by Phirus »

Code: Select all

<?php

	$time = 54.2333333333;

	echo printf("%6.2f",$time);

?>
Hope that helps,

Phirus
?>
Post Reply