From 487ee4626db2a3e2b44140436460f3e335707390 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 2 Jul 2012 16:19:36 +0200 Subject: [PATCH] update Ox.formatUnit --- source/Ox/js/Format.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index fa4ae0ef..83e9532d 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -669,7 +669,7 @@ Ox.formatString Basic string formatting > Ox.formatString('{a}{b}', {a: 'foo', b: 'bar'}) 'foobar' @*/ -Ox.formatString = function (string, collection) { +Ox.formatString = function(string, collection) { return string.replace(/\{([^}]+)\}/g, function(string, match) { return collection[match]; }); @@ -684,7 +684,7 @@ Ox.formatUnit Formats a number with a unit @*/ Ox.formatUnit = function(number, string, decimals) { return Ox.formatNumber(number, decimals) - + (string == '%' ? '' : ' ') + string; + + (/^[:%]/.test(string) ? '' : ' ') + string; }; /*@