PDA

View Full Version : remove decimal places in rand()


b6gm6n
12-13-2005, 03:21 AM
what ya think to the select below... the highscore part shows

value.000

$randomgame = $db->query_first("SELECT gameid,title,description,stdimage,highscore FROM ".TABLE_PREFIX."arcade_games ORDER BY RAND() LIMIT 1");

how to remove those 3 little naughts! :)
I've looking into various things but i cannot suss it, please help

-b6

sabret00the
12-13-2005, 08:51 AM
you've got a number of choices, you can truncate the value using substr() or you can use ceil() or floor() to round up or down.

b6gm6n
12-13-2005, 12:35 PM
thankyou

-b6