diff options
| author | eunhhu <[email protected]> | 2026-10-19 01:48:45 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-19 01:48:45 +0100 |
| commit | 9d3ed820105d97061aa5ce8d32b934cac85df180 (patch) | |
| tree | abb45c32f4270d57d7e437f2c7e96dc3ac4907aa /docs | |
| parent | 5ab44af129f0736be485afda6a2a73ff04660598 (diff) | |
| download | aup-9d3ed820105d97061aa5ce8d32b934cac85df180.tar.gz aup-9d3ed820105d97061aa5ce8d32b934cac85df180.zip | |
Pure 027's 5c: {cents:.2d}, an i64 (or a number) in minor units written with its last N digits after a point (1234 at .2d is 12.34, -5 is -0.05), not Python's form, so the random formats test it against Decimal(v).scaleb(-N) written as .Nf (digits on two in five d columns); digits refused off f and d (the diagnostic names .2d), an i64's .2f pointing at .2d; 002's formats say so
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/002-dsl-direction.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/design/002-dsl-direction.md b/docs/design/002-dsl-direction.md index 87b3803..8a70906 100644 --- a/docs/design/002-dsl-direction.md +++ b/docs/design/002-dsl-direction.md @@ -657,7 +657,7 @@ on check { out = out + text(d[i .. i + 1]) # 덧붙이기(제자리) i = i + 1 } - shown = "{i:5}|{h:08x}|{price:.2f}" # 형식 + shown = "{i:5}|{h:08x}|{price:.2f}|{cents:.2d}" # 형식 } ``` @@ -665,8 +665,10 @@ on check { - `0`은 부호 뒤를 0으로 채운다. 폭은 255까지다. - `d x X b o`는 i64나 정수인 수를 그 진법으로 쓴다. 정수가 아닌 수면 이벤트가 `limit`으로 실패한다. - `f`는 수를 고정 자릿수로 쓴다(자릿수 0–30, 기본 6). −0은 0으로 쓴다. + - `.Nd`는 파이썬에 없다: 정수를 최소 단위로 보고 끝의 N자리를 소수점 뒤에 쓴다(돈의 센트: `{cents:.2d}`에서 1234는 `12.34`, −5는 + `-0.05`. Pure 027의 5단계). 돈은 i64의 센트라 셈이 정확하고, 보일 때만 나눈다. - 형식 없이 폭만 주면 지금의 글자를 왼쪽으로 채운다. bool은 폭만 받는다. - - 파이썬의 `format()`과 같은 글자를 낸다(무작위 대조). + - 파이썬의 `format()`과 같은 글자를 낸다(무작위 대조, `.Nd`는 그 Decimal을 `.Nf`로 쓴 것과). - **잇기** `a + b`는 text끼리, 바이트끼리 잇는다. 섞으면 진단이 나온다. - **자르기** `b[a .. c]`는 a부터 c 앞까지의 바이트다. - text는 바이트 자리로 자르고, 글자 가운데를 자르면 `encoding`으로 실패한다. |
