]> git.gag.com Git - fw/quantimotor/commitdiff
trim floats to 3 digits after the decimal
authorBdale Garbee <bdale@gag.com>
Sun, 25 May 2025 03:20:25 +0000 (21:20 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 25 May 2025 03:20:25 +0000 (21:20 -0600)
ui/app.py

index f870275c18ce740d61e6c6b441246b434bfc24f4..efc7593d697dc80c1688075bc2c0c9d875bf594c 100755 (executable)
--- a/ui/app.py
+++ b/ui/app.py
@@ -108,13 +108,13 @@ class App:
       voltage = (float(rawstring) + float(OFFSET)) * float(SCALE) / 1000
       match chan.id:
         case 'voltage0':
-          pressure = voltage
+          pressure = '%.3f'%(voltage)
         case 'voltage1':
-          thrust = voltage
+          thrust = '%.3f'%(voltage)
         case 'voltage2':
-          pyro = voltage
+          pyro = '%.3f'%(voltage)
         case 'voltage3':
-          battery = voltage
+          battery = '%.3f'%(voltage / (22/222))
 
     armed = sense_armed()