Search the Community
Showing results for tags 'calculations php config'.
-
//I am calculating payroll contributions to 401k to give employees a baseline outlook for 20 years to check against their portfolio quarterly reports. It all works until numbers start getting larger. Nothing //ginormous...this is the reason I am at a loss. Is there a setting in php.ini that would be bombing? Sorry...the code formatting tool is acting dumb. $Pay_earnings = $_REQUEST['Pay_earnings']; $Perc_contr = $_REQUEST['Perc_contr']/100; $Perc_emp_contr = $_REQUEST['Perc_emp_contr']/100; if($Perc_contr > .08){ $perc_non_matched = $Perc_contr - .08; $Perc_contr = .08; }else{ $non_matched_contri = 0; } $yourContrib = number_format(round( (($Pay_earnings*$Perc_contr)+($Pay_earnings*$perc_non_matched)), 2)); $empContrib = number_format(round(($Pay_earnings*$Perc_contr)*$Perc_emp_contr,2)); $totalContrib = number_format($yourContrib+$empContrib); echo " <br /> <table class='Standard' align='center' width='900' border='1'> <tr bgcolor='#CCCCCC'> <td colspan='3' align='center'><h1>Per Paycheck Contribution</h1></td> </tr> <tr> <td width='' align='center'><b><big>Your Contribution</big></b></td> <td width='' align='center'><b><big>Employer Matched Contribution</big></b></td> <td width='' align='center'><b><big>Total Contribution</big></b></td> </tr> <tr> <td width='' align='center'>$"."$yourContrib</td> <td width='' align='center'>$"."$empContrib</td> <td width='' align='center'>$"."$totalContrib</td> </tr> <tr bgcolor='#CCCCCC'> <td colspan='3' align='center'><h1>Projection Base(Without Investment Return)</h1></td> </tr> This works find until my $Perc_contr rises above 40. Then my $totalContrib toward the bottom does not reflect my $yourContrib in the addition. But the actual TD holding the $yourContrib is fine. I am frikin dumbfounded....