php numbers formatting

claracandy

New Member
I have this variable \[code\]$mynumber\[/code\] that echos a number between 1 and 100, on the output, I need this number to be divided by 2, round it, and place a dot between the digits, like this:\[code\]<?php echo $mynumber ?>//output e.g. 55\[/code\]I need to output 2.7 instead ( 55/2 -> 27.5 -> 27 -> 2.7 )I'm having troubles formatting it the right way, can you help me out?Thanks
 
Top