title: How to update PyQt5 label with unrounded variable value?
body: <p>I keep track of some variables that are very small (smaller than 1) and would like to update a label on the screen with their value. However, the labels stay at 0 (sometimes they go to 1) even though the value of the variable is smaller than 1. </p>
  
  <p>How do I tell my program to explicitly print an unrounded value?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import sys
  import random
  from PyQt5.QtCore import QTimer
  from PyQt5.QtWidgets import (QApplication, QLabel, QWidget)
  from PyQt5.QtGui import QPainter
  
  
  class MouseTracker(QWidget):
      distance_from_target = 0
      mouse_x_pos = 0
      mouse_y_pos = 0
      target_x_pos = 0
      target_y_pos = 0
      target_x_velocity = 0
      target_y_velocity = 0
      target_x_acceleration = 0
      target_y_acceleration = 0
  
      def __init__(self, parent=None):
          super(MouseTracker, self).__init__(parent=parent)
          self.initUI()
          self.setMouseTracking(True)
          self.timer = QTimer(self)
          self.timer.timeout.connect(self.changePosition)
          self.timer.start(1)
  
      def changePosition(self):
          random.seed()
          self.target_x_acceleration = random.randint(-10, 10) / 100
          self.target_y_acceleration = random.randint(-10, 10) / 100
  
          self.target_x_velocity += self.target_x_acceleration
          self.target_y_velocity += self.target_y_acceleration
  
          self.target_x_pos += self.target_x_velocity
          self.target_y_pos += self.target_y_velocity
  
          self.distance_from_target = round(
              ((self.mouse_y_pos - self.target_y_pos) ** 2 + (self.mouse_x_pos - self.target_x_pos) ** 2) ** 0.5)
          self.label.setText(
              'Mouse: (%d : %d)' % (self.mouse_x_pos, self.mouse_y_pos) + "   Distance from target: " + str(self.distance_from_target)
              + "\nTarget position: (%d : %d)" % (self.target_x_pos, self.target_y_pos)
              + "\nTarget velocity: (%d : %d)" % (self.target_x_velocity, self.target_y_velocity)
              + "\nTarget acceleration: (%d : %d)" % (self.target_x_acceleration, self.target_y_acceleration))
          self.update()
  
      def initUI(self):
          self.setGeometry(200, 200, 1000, 500)
          self.setWindowTitle('Mouse Tracker')
          self.label = QLabel(self)
          self.label.resize(500, 100)
          self.show()
  
      def mouseMoveEvent(self, event):
          self.mouse_x_pos = event.x()
          self.mouse_y_pos = event.y()
          self.update()
  
      def mousePressEvent(self, event):
          self.target_x_velocity = 0
          self.target_y_velocity = 0
          self.target_x_acceleration = 0
          self.target_y_acceleration = 0 
          self.target_x_pos = event.x()
          self.target_y_pos = event.y()
          self.distance_from_target = round(
              ((self.mouse_y_pos - self.target_y_pos) ** 2 + (self.mouse_x_pos - self.target_x_pos) ** 2) ** 0.5)
          self.update()
  
      def paintEvent(self, event):
          q = QPainter()
          q.begin(self)
          q.drawLine(self.mouse_x_pos, self.mouse_y_pos, self.target_x_pos, self.target_y_pos)
          q.drawEllipse(self.target_x_pos - self.distance_from_target, self.target_y_pos - self.distance_from_target, self.distance_from_target*2, self.distance_from_target*2)
  
  app = QApplication(sys.argv)
  w = MouseTracker()
  sys.exit(app.exec_())
  </code></pre>
  
  <p>The variables in question are <code>target_x_velocity</code>, <code>target_y_velocity</code>, <code>target_x_acceleration</code>, and <code>target_y_acceleration</code>.</p>