From 2fda214e83c9ab9a29c67c1ddf2cece7ba761db4 Mon Sep 17 00:00:00 2001
From: Sanj
Date: Thu, 1 Sep 2011 03:55:36 +0530
Subject: [PATCH 1/2] 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);
From 03146ae7569d3d8a46c86389ccc185df18a6e02d Mon Sep 17 00:00:00 2001
From: Sanj
Date: Thu, 1 Sep 2011 04:00:03 +0530
Subject: [PATCH 2/2] er
---
gazetteer/static/js/feature_admin.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gazetteer/static/js/feature_admin.js b/gazetteer/static/js/feature_admin.js
index ee4cdf7..589c9aa 100644
--- a/gazetteer/static/js/feature_admin.js
+++ b/gazetteer/static/js/feature_admin.js
@@ -13,7 +13,7 @@ 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 similarity = Math.round(parseFloat(d.similarity) * 1000) / 10;
var distance = Math.round(parseFloat(d.distance));
$(' | ').text(d.feature_type).appendTo($tr);
$(' | ').text(similarity).appendTo($tr);