回答編集履歴
2
例示リンクを追加
answer
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
[6.1.3. 書式指定文字列の文法](https://docs.python.jp/3/library/string.html#formatstrings)
|
9
9
|
[grammar-token-width](https://docs.python.jp/3/library/string.html#grammar-token-width)
|
10
10
|
- `format`の書式はC言語の`printf`と同じ推測して`printf 書式 double 桁`などと検索すると
|
11
|
+
[フォーマット指定子一覧](http://www.k-cube.co.jp/wakaba/server/format.html)
|
11
12
|
[第5章 標準入出力関数(1)](http://www9.plala.or.jp/sgwr-t/c/sec05.html)
|
12
13
|
などでC言語での実サンプルが見つかる。
|
13
14
|
|
1
修正
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
`{0:013.6f}`の`13`部分は、小数点も含めた`
|
1
|
+
`{0:013.6f}`の`13`部分は、小数点も含めた`桁幅`を指定します。
|
2
2
|
```Python
|
3
|
-
print("{0:013.6f}".format(912.0))
|
3
|
+
print("{0:013.6f}".format(912.0)) # 000912.000000
|
4
4
|
```
|
5
5
|
|
6
6
|
■探し方
|