From 00befc85b88dadf797ecbf6e078bd9e72e7c129a Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Wed, 27 Jan 2016 05:58:11 -0500 Subject: [PATCH] Strip suffix correctly for stats. --- entry.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entry.js b/entry.js index 95d642c..ae51f57 100644 --- a/entry.js +++ b/entry.js @@ -220,14 +220,16 @@ function speed(distance, time) { /* Format a distance. */ function format_distance(distance, suffix) { - if (suffix !== false) suffix = 'Ly'; + if (typeof suffix != 'undefined') suffix = ''; + else suffix = 'Ly'; return String(distance.toFixed(2)) + suffix; } /* Format a speed. */ function format_speed(speed, suffix) { - if (suffix !== false) suffix = '/h'; - return format_distance(speed) + suffix; + if (typeof suffix != 'undefined') suffix = ''; + else suffix = '/h'; + return format_distance(speed, suffix); } /* Find the joker checkbox. */ -- 2.7.4