i'm new to php. please i would want to get figure from user's input amount such as if a user pays 2500 i want to get 2.5 from the amount he inputed examples below
1000 ------ 1 ,
1500 ------ 1.5,
1600 ------ 1.6 ,
1800 ------ 1.8 ,
2000 ------ 2 ,
2200 ------ 2.2 ,
2500 ------ 2.5 ,
etc
is there any way i can get something like this above or to divide user input amount to get something like the figures above please
$num = 1700;
$whole = (int) $num;
$frac = $num / $whole;