GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — modify · enoughbr/StarterLearningPython@23b140c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • 109.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎109.md‎

Copy file name to clipboardExpand all lines: 109.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
%E |指数 (基底写为E)
4747
%f |浮点数
4848
%F |浮点数,与上相同
49-
%g |指数(e)或浮点数 (根据显示长度)
49+
%g |指数(e)或浮点数 (根据显示长度)
5050
%G |指数(E)或浮点数 (根据显示长度)
5151

5252
看例子:
@@ -67,7 +67,7 @@
6767
>>> print "Today's temperature is %+.2f" % 12.235
6868
Today's temperature is +12.23
6969

70-
注意,上面的例子中,没有实现四舍五入的操作。只是截取。
70+
注意,上面的例子中,没有实现四舍五入的操作,貌似只是截取。其实,我在这里用的那个12.235的确有点特殊化了。你不妨修改为别的数,试一试,看看是不是四舍五入了。至于这个数的特殊性,如果你不能理解,就请回头找一找本教程中关于十进制与二进制数转换的讲述。
7171

7272
关于类似的操作,还有很多变化,比如输出格式要宽度是多少等等。如果看官在编程中遇到了,可以到网上查找。我这里给一个参考图示,也是从网上抄来的。
7373

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.