string-format: String.format/formatted/printf cheat sheet module (specifier anatomy, rounding vs C printf, locales, Indian lakh/crore grouping Formatter cannot do, format exceptions, %t dates, concat cost), 11 contract tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7Sr2zcoRD2watXv1G
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
== four spellings, one result ==
|
||||
Hi Asha, 3 items, Rs 1499.50
|
||||
Hi Asha, 3 items, Rs 1499.50
|
||||
Hi Asha, 3 items, Rs 1499.50
|
||||
Hi Asha, 3 items, Rs 1499.50
|
||||
format == formatted == Formatter: true
|
||||
|
||||
== formatted() on a text block ==
|
||||
Invoice for Asha
|
||||
items : 3
|
||||
total : 1,499.50
|
||||
|
||||
== printf returns the PrintStream, so calls chain ==
|
||||
one two three
|
||||
|
||||
== %n vs \n ==
|
||||
true on this platform (line.separator is \n)
|
||||
|
||||
== an array argument: spread as the varargs, unless you cast it to Object ==
|
||||
x-1
|
||||
p-q
|
||||
true
|
||||
Reference in New Issue
Block a user