GOLF(2gg)
π GOLF(2gg) β the number-string page, bestie edition π
okay so this is from the GOLF(2gg) manual, Development section, and it's literally all about turning numbers into strings. no cap. let's get into it π«Ά
β¨ NAME β¨
number-string β (numbers)
π PURPOSE π
Convert number to string. that's it. that's the whole job. iconic behavior honestly π
π¦ SYNTAX π¦
number-string <number> [ to <string> ] \
[ base <base> ] \
[ status <status> ]
look at her. so structured. so slay β¨
πΈ DESCRIPTION πΈ
so here's the tea, bestie: <number> gets converted into <string>, and that lands in the to clause. the conversion uses <base> from the base clause, and <base> defaults to 10 if you don't say otherwise. <base> can be anywhere between 2 and 36, inclusive β like, both ends count, don't come for me π₯
<number> can be positive or negative (so yes, signed, she contains multitudes π) and can be any integer type up to 64-bit β char, int, long, long long, etc. etc. you get the vibe. and if the to clause is omitted, then <number> just gets printed out. main character moment for a number, honestly π
okay important: any letters in<string>(which depends on the<base>, iykyk) are always lower-case. always. no uppercase shenanigans. periodt. π
if there's an error β like if <base> is incorrect or whatever β then the <status> number (in the status clause) is GG_ERR_FAILED. otherwise it's GG_OKAY. so you always know where you stand, bestie π
using number-string (and the print-out that's based on it) for converting and outputting numbers is high-performance and recommended if your application needs to do that a lot. like, if you're doing this constantly, this is the move, fr fr. and if number-string prints out a number (meaning the to clause is omitted) and this happens within write-string, then <number> is output into the buffer that builds a new string. cute, right? π
π EXAMPLES π
this one allocates memory for string "x" to be "801":
set-number x = 801
number-string x to res
and this one stores "-238f" into string "res":
set-number x = -9103
number-string x to res base 16
and to print out a number, -131:
set-number x = -131
number-string x
ate that. no crumbs. π₯
π SEE ALSO π
- Numbers
also go check out: abs-number, number-expressions, number-string, set-number, string-number β and See all documentation if you want the whole cinematic universe π
mwah π that's the page! this gorgeous little manual page is sourced from version $VERSION and dated $DATE β GOLF(2gg) forever, bestie π¦β¨π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms