Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

57 users online



calculating fractions,decimals and percents

calculating fractions,decimals and percents

Currently viewing this thread: 1 (0 members and 1 guests)


sgt_underpants

sgt_underpants

Neverside Newbie
Status: Offline!

calculating fractions,decimals and percents

I have tried to write a script that will take two totals, supplied by the client user, and return a fraction, a decimal and a percentage based on the user inputs. Say the user is asked for "how many men" and "how many women". I want the answers to be returned to be the percentage of men, the fractional comparison of men to women and the decimal representation of men to women and vice versa. If you need my form I can send it to you. Any help would be greatly appreciated.

___________________

"Facts are meaningless. You could use facts to prove anything that's even remotely true."
-- Homer Simpson

BigToach

BigToach

Neversidian
Status: Offline!

$fraction = "$men/$woman";
$total = $men + $woman;
$mendecimal = $total / $men;
$womandecimal = $total / $woman;
$menpercent = $mendecimal * 100;
$menpercent = round($menpercent);
$womanpercent = $womandecimal * 100;
$womanpercent = round($womanpercent);
sure i messed up somewhere in there but thats the idea lol

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0155 seconds.