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(0.333333, '%', 2, 100)
"33.33%"
> Ox.formatUnit(100/3, 'm', 2)
'33.33 m'
> Ox.formatUnit(100/3, '%')
'33%'
@*/
// FIXME: why factor??
Ox.formatUnit = function(number, string, decimals, factor) {
decimals = Ox.isUndefined(decimals) ? 3 : decimals;
factor = Ox.isUndefined(factor) ? 1 : factor;
return Ox.formatNumber(number * factor, decimals)
Ox.formatUnit = function(number, string, decimals) {
return Ox.formatNumber(number, decimals)
+ (string == '%' ? '' : ' ') + string;
};