remove 'factor' argument from Ox.formatUnit

This commit is contained in:
rolux 2012-06-04 12:41:40 +02:00
parent f0ba793a85
commit fbe2513cb4

View file

@ -646,14 +646,13 @@ Ox.formatString = function (string, collection) {
/*@ /*@
Ox.formatUnit <f> Formats a number with a unit Ox.formatUnit <f> Formats a number with a unit
> Ox.formatUnit(0.333333, '%', 2, 100) > Ox.formatUnit(100/3, 'm', 2)
"33.33%" '33.33 m'
> Ox.formatUnit(100/3, '%')
'33%'
@*/ @*/
// FIXME: why factor?? Ox.formatUnit = function(number, string, decimals) {
Ox.formatUnit = function(number, string, decimals, factor) { return Ox.formatNumber(number, decimals)
decimals = Ox.isUndefined(decimals) ? 3 : decimals;
factor = Ox.isUndefined(factor) ? 1 : factor;
return Ox.formatNumber(number * factor, decimals)
+ (string == '%' ? '' : ' ') + string; + (string == '%' ? '' : ' ') + string;
}; };