From d952405886dab44f12c1de53b57912b34320c7c8 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 28 Nov 2018 15:14:45 +0100 Subject: Get calibration to show nice numbers on web page --- gui/dpd/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gui/dpd') diff --git a/gui/dpd/__init__.py b/gui/dpd/__init__.py index 85abe86..2c7649b 100644 --- a/gui/dpd/__init__.py +++ b/gui/dpd/__init__.py @@ -57,8 +57,8 @@ class DPD: def capture_calibration(self): tx_ts, tx_median, rx_ts, rx_median, coarse_offset, correlation_coefficient = self.capture.calibrate() result = {'status': "ok"} - result['tx_median'] = "{:.2}dB".format(20*np.log10(tx_median)) - result['rx_median'] = "{:.2}dB".format(20*np.log10(rx_median)) + result['tx_median'] = "{:.2f}dB".format(20*np.log10(tx_median)) + result['rx_median'] = "{:.2f}dB".format(20*np.log10(rx_median)) result['tx_ts'] = tx_ts result['rx_ts'] = rx_ts result['coarse_offset'] = int(coarse_offset) -- cgit v1.2.3