diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js
index 132fbbff305..adbd09d7908 100644
--- a/app/assets/javascripts/discourse/helpers/application_helpers.js
+++ b/app/assets/javascripts/discourse/helpers/application_helpers.js
@@ -267,30 +267,32 @@ Ember.Handlebars.registerHelper('float', function(property, options) {
@for Handlebars
**/
Handlebars.registerHelper('number', function(property, options) {
- var n, orig, title, result;
- orig = parseInt(Ember.Handlebars.get(this, property, options), 10);
- if (isNaN(orig)) {
- orig = 0;
- }
- title = orig;
+
+ var orig = parseInt(Ember.Handlebars.get(this, property, options), 10);
+ if (isNaN(orig)) { orig = 0; }
+
+ var title = orig;
if (options.hash.numberKey) {
- title = I18n.t(options.hash.numberKey, {
- number: orig
- });
+ title = I18n.t(options.hash.numberKey, { number: orig });
}
+
// Round off the thousands to one decimal place
- n = orig;
+ var n = orig;
if (orig > 999 && !options.hash.noTitle) {
n = (orig / 1000).toFixed(1) + "K";
}
- result = "" + n + "";
+
return new Handlebars.SafeString(result);
});
@@ -310,6 +312,7 @@ Handlebars.registerHelper('date', function(property, options) {
property = property.hash.path;
}
}
+
var val = Ember.Handlebars.get(this, property, options);
if (val) {
var date = new Date(val);
diff --git a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars
index 634307d113b..d9a415ef146 100644
--- a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars
@@ -7,7 +7,7 @@