Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03d7e4f

Browse files
committed
feature#7196 Explained how to improve the readability of long numeric literals (javiereguiluz)
This PR was squashed before being merged into the 3.2 branch (closes#7196).Discussion----------Explained how to improve the readability of long numeric literalsThisfixes#7183.Commits-------494a9ae Explained how to improve the readability of long numeric literals
2 parents2e23084 +494a9ae commit03d7e4f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎components/yaml.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,25 @@ changed using the third argument as follows::
203203
foo:bar
204204
bar:baz
205205
206+
Numeric Literals
207+
................
208+
209+
Long numeric literals, being integer, float or hexadecimal, are known for their
210+
poor readability in code and configuration files. That's why YAML files allow to
211+
add underscores to improve their readability:
212+
213+
..code-block::yaml
214+
215+
parameters:
216+
credit_card_number:1234_5678_9012_3456
217+
long_number:10_000_000_000
218+
pi:3.14159_26535_89793
219+
hex_words:0x_CAFE_F00D
220+
221+
During the parsing of the YAML contents, all the ``_`` characters are removed
222+
from the numeric literal contents, so there is not a limit in the number of
223+
underscores you can include or the way you group contents.
224+
206225
Advanced Usage: Flags
207226
---------------------
208227

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp