Rating system problem

software development

#1

I am trying to make a rating system for my website and I have made test pages to try out my script before I put it to use. The script uses a flat file database to keep track of the info.

Can anyone tell me an easy way to make the avg. rating round to the nearest one thousanth (0.00).

Thanks for any help you can give.

Brad Campbell
woochoochinchilla.com


#2

If you’re using PHP, have a look at round(). Maybe number_format() will come in handy for you at some point as well, if you would rather an even number like 9 displayed as 9.00.


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.


#3

Sorry, I’m using perl/cgi. Would round() work in a cgi? If so, what do I put in the () to round it to the nearest one thousanth?

Brad Campbell
woochoochinchilla.com


#4

I never got into Perl, but I’d imagine that any basic PHP functions would also exist in Perl–but I don’t know what they’d be called.

If they don’t have a specific round() function, I would guess that it’s something that could be written using existing functions.

Maybe there are a few Perl users here that will read the thread–but if not, you could always give Google a try, or maybe a programming forum on a site like Digitalpoint.com or sitepoint.com.


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.