mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
(web) Math.roundWithPrecision does the exact same thing as toFixed.
This commit is contained in:
@@ -107,18 +107,6 @@ function setInnerHTML( e, html )
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Round a float to a specified number of decimal
|
||||
* places, stripping trailing zeroes
|
||||
*
|
||||
* @param float floatnum
|
||||
* @param integer precision
|
||||
* @returns float
|
||||
*/
|
||||
Math.roundWithPrecision = function(floatnum, precision) {
|
||||
return Math.round( floatnum * Math.pow ( 10, precision ) ) / Math.pow( 10, precision );
|
||||
};
|
||||
|
||||
/*
|
||||
* Given a numerator and denominator, return a ratio string
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user