|
.g.e.n.e.r.a.l.
.p.h.p. .c.o.d.e.
.j.a.v.a.s.c.r.i.p.t. .c.o.d.e.
Modified in < 3 days.
Misc. Stats For This Page
Operating Systems
Browsers
|
.c.a.l.c.u.l.a.t.e.p.e.r.c.e.n.t.i.l.e.
This one took me a while. I needed to calculate the percentile of a set
of values for another project I was working on. Not being a mathematician,
I first had to learn how to do this mathematically before I could even
begin to program it. At the time, Google did not return very many
results for programming a percentile function in PHP. I decided that
since I took me so long to figure it out I had best post it here not
only for me but for anyone else interested in doing this as well.
CalculatePercentile(ARRAY, VALUE [,PRECISION]) Function that calculates the percentile VALUE lands in when compared to the values in ARRAY. Optional thrid parameter of PRECISION is the number of decimal places to return to percentile in, defaults to 2. Returns FALSE if VALUE is out of range of ARRAY.Here is the code:
<?php |
||||||||||||||||||||||||||
|
The trademarks, logos and service marks ("Marks") displayed on this Web site are the property of cKorp or other third parties.
You are not permitted to use these Marks without the prior written consent of cKorp or such third party which may own the Mark.
Use of cKorp trademarks almost always requires written permission or a license.
|
|||||||||||||||||||||||||||