From fbe2513cb438b4458c639291547f0b7ee817bd04 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 4 Jun 2012 12:41:40 +0200 Subject: [PATCH] remove 'factor' argument from Ox.formatUnit --- source/Ox/js/Format.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index a8d09630..212586bd 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -646,14 +646,13 @@ Ox.formatString = function (string, collection) { /*@ Ox.formatUnit 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; };