Hopefully put an end to all these percentage bugs in the web client

This commit is contained in:
Malcolm Jarvis
2009-04-24 03:21:15 +00:00
parent 7f60d9db17
commit 85b33e22be
2 changed files with 3 additions and 3 deletions

View File

@@ -206,7 +206,7 @@ Math.roundWithPrecision = function(floatnum, precision) {
*/
Math.ratio = function( numerator, denominator )
{
var result = Math.roundWithPrecision((numerator / denominator), 2);
var result = Math.floor(100 * numerator / denominator) / 100;
// check for special cases
if (isNaN(result)) result = 0;