Right now, tostr(n) converts to decimal, and tostr(n,anything_except_nil_or_false) converts to hex.
Could it use the optional second arg as a base if it's a number? e.g.
>?tostr(255) 255 >?tostr(255,false) 255 >?tostr(255,true) 0x00ff.0000 >?tostr(255,16) 0x00ff.0000 >?tostr(255,10) 255 >?tostr(255,2) 0b0000000011111111.0000000000000000 |
For the sake of simplicity, you could limit it to the bases the parser can read. I think that's just decimal, hex, and binary.
Second this. Although a good convert to and from base 64 may also be handy.
Hmmm I don't use the
tostr(n,true) |
too often but I think this would be cool ya.
@ElGregos
Hm, probably not, since this only converts a single 16.16 number.
[Please log in to post a comment]