current position:Home>Pyqt5 how to output percentages directly?
Pyqt5 how to output percentages directly?
2022-02-04 16:50:53 【CSDN Q & A】
The interface is like this , The final score column wants to output the percentage .
If it is to use print, I know how to do it . What we use here is textedit, I don't know if there are more convenient controls ?
Take the answer :
You will be textedit The value inside is assigned first , In giving textedit Do reality , such as
Original value =0.890909090909 Percentage ratio =f'{round( Original value *100,3)}%'textedit(showvalue= Percentage ratio )
Ideas First format the string or display value and then give it to textedit Show or give textedit Content assignment of
Other answers 2:
print('{:.2%}'.format(x))
Other answers 3:
you are here python The script sets a variable , In the input pyqt No. It'll be ok
Such as :text = '{}%'.format(0.890*100)
And then call :textedit(text)
Other answers 4:
use print And give text There's no difference in passing values
Do you use print If you don't format it, it's the same. A pile of decimal points
copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041650507618.html
The sidebar is recommended
- What are the advantages of real-time data processing based on maxcompute?
- Android source code analysis Series 1 - activity startup and interface loading, HTML5 mobile terminal development interview
- What are the similarities and differences between worker and excutor?
- Android source code analysis: implementation principle of lrucache caching mechanism, self-evaluation of Android development resume
- MySQL field name batch case conversion, Java work in 2021 may be more difficult to find
- DTS self built MySQL synchronizes to RDS. What SQL operations does MySQL support synchronization?
- MySQL Optimization: Performance Analysis of like and = in where, Java Architect growth express updated to
- What is ECS (Elastic Compute service)?
- What are the differences among the three Android annotation frameworks dagger, hilt and Koin?, Retrofit benefits
- What is the difference between MySQL hash index and B + tree?
guess what you like
-
Why ECS?
-
What are the permission requirements for DTS self built Mysql to synchronize to RDS MySQL database account?
-
What is the difference between MySQL inner connection, left connection and right connection?
-
What are the two shared variables provided by spark?
-
What does optimizing shard number mean?
-
What are the four components of Hadoop?
-
DTS self built MySQL is synchronized to RDS MySQL database. What is the method of account creation and authorization?
-
What are the main functional components of ECS?
-
What are the common billing methods for ECS?
-
What is the relationship between serverless and logging?
Random recommended
- How many layers does the MySQL logical architecture diagram have?
- What is the function of shard number?
- Why do we need MapReduce?
- What are the three paradigms of database?
- What are the common developer tools for calling ECS APIs?
- Configuration and description of source database information synchronized from DTS self built Mysql to RDS MySQL?
- What are the trends and challenges of serverless?
- What are the MySQL permission tables?
- What is the process of installing httpd service and PHP in ganglia?
- What is the role of Alibaba cloud toolkit?
- What is the log centralization of serverless applications?
- Configuration and description of target database information synchronized from DTS self built Mysql to RDS MySQL?
- HTML common tag examples
- Laravel statement reports an error. How to solve it?
- Please answer the questions about # C #!
- Use pagination JS paging plug-in paging, get the number of pages, but click the next page without refreshing the data
- C + + keyboard input, sorting, list output
- Technologies needed for wechat applet development
- The expression has been given to find the image?
- OSPF address configuration of switch
- Let's see how to correct this mistake. I didn't find it myself.
- PCIe TX / RX pin constraint problem
- HDU1096 presentation wrong
- Does anyone understand why the first process will operate through P and the second process will block at p?
- Data structure PTA questions do not know how to change
- On the grid position and width of Tkinter
- Use of react material UI 5.0 components
- Android modifies the interface displayed on the white screen through the theme of activity
- When configuring Powermode in vscode, expected comma is displayed
- Stc89c52rc controls the stepping motor, and the program card is in the first line of main,
- What's the difference between the same sentence?
- Expression 1 + 4 / 5 + 15 & lt; The value of 7 + 4% 5 + (8,10) is
- After the spring boot project is jar packaged and deployed to alicloud server, init datasource error is displayed. But local operation is good.
- The automated test tool RF cannot modify the font size
- The problem that DSS + FTP cannot be played online
- How to automatically execute pycharm file after clicking it
- How to solve the problem that the raspberry pie prompt cannot locate the software package when installing ngnix?
- How should I make up this problem? Please ask me
- Beg, an exercise problem, can't figure out a way of thinking
- How to judge whether the folding screen is unfolded when there is a problem of folding screen adaptation at the mobile terminal?