From 2fda214e83c9ab9a29c67c1ddf2cece7ba761db4 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 1 Sep 2011 03:55:36 +0530 Subject: [PATCH] format distance and similarity values --- gazetteer/static/js/feature_admin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gazetteer/static/js/feature_admin.js b/gazetteer/static/js/feature_admin.js index 7312634..ee4cdf7 100644 --- a/gazetteer/static/js/feature_admin.js +++ b/gazetteer/static/js/feature_admin.js @@ -13,8 +13,10 @@ function getRow(d) { var $tr = $(''); var $one = $('').appendTo($tr); var $a = $('').attr("href", "/admin/places/feature/" + d.id).text(d.preferred_name).appendTo($one); + var similarity = Math.round(parseFloat(d.similarity) * 100); + var distance = Math.round(parseFloat(d.distance)); $('').text(d.feature_type).appendTo($tr); - $('').text(d.similarity).appendTo($tr); + $('').text(similarity).appendTo($tr); $('').text(d.distance).appendTo($tr); $('').text(d.time_frame).appendTo($tr); var $primary_td = $('').appendTo($tr);