format distance and similarity values

This commit is contained in:
Sanj 2011-09-01 03:55:36 +05:30
parent 8e44644d66
commit 2fda214e83

View File

@ -13,8 +13,10 @@ function getRow(d) {
var $tr = $('<tr />'); var $tr = $('<tr />');
var $one = $('<td />').appendTo($tr); var $one = $('<td />').appendTo($tr);
var $a = $('<a />').attr("href", "/admin/places/feature/" + d.id).text(d.preferred_name).appendTo($one); var $a = $('<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));
$('<td />').text(d.feature_type).appendTo($tr); $('<td />').text(d.feature_type).appendTo($tr);
$('<td />').text(d.similarity).appendTo($tr); $('<td />').text(similarity).appendTo($tr);
$('<td />').text(d.distance).appendTo($tr); $('<td />').text(d.distance).appendTo($tr);
$('<td />').text(d.time_frame).appendTo($tr); $('<td />').text(d.time_frame).appendTo($tr);
var $primary_td = $('<td />').appendTo($tr); var $primary_td = $('<td />').appendTo($tr);