code: def change_format(self):
          
          format, valid = QInputDialog.getText(self, _( 'Format'),
                                   _( "Float formatting"),
                                   QLineEdit.Normal, self.model.get_format())
          if valid:
              format = str(format)
              try:
                  format % 1.1
              except:
                  QMessageBox.critical(self, _("Error"),
                                       _("Format (%s) is incorrect") % format)
                  return
              self.model.set_format(format)
docs: Change display format