Help for this page

Select Code to Download


  1. or download this
    # When $val has normal integer .
    $val=89.9 ;
    printf ( "%.2f", $val  )  ;
    
  2. or download this
     
    $val='$89.9';
    printf ('$'."%.2f",substr($val, 1,length($val))) ;