mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Improve string/interpolation formatting (#1491)
- The '#' component for type 's' now escapes the string characters - The '#' component for type 'f' now prints a precision suffix - The new 'q' component specifies a precision value
This commit is contained in:
@@ -3,11 +3,12 @@ def m equ -42
|
||||
def f equ -123.0456
|
||||
def pi equ 3.14159
|
||||
def s equs "hello"
|
||||
def t equs "\"\\t\" is '\t'"
|
||||
|
||||
println "<{ -6d:n}> <{+06u:n}> <{5x:n}> <{#16b:n}>"
|
||||
println "<{u:m}> <{+3d:m}> <{#016o:m}>"
|
||||
println "<{f:pi}> <{06.f:f}> <{.10f:f}>"
|
||||
println "<{#-10s:s}> <{10s:s}>"
|
||||
println "\"{#-20s:t}\", \"{#20s:t}\", \"{20s:t}\""
|
||||
|
||||
macro foo
|
||||
println "\1 <{\1}>"
|
||||
|
||||
Reference in New Issue
Block a user