"RokuKC" wrote:
Having StrI(int, 10) format as signed is by design, and I don't anticipate that changing.
I am guessing you said "by design" to mean that the behavior comes from implementation where
stri(intVal) has implied radix=10 from a general definition like
function stri(intVal as Integer, radix = 10 as Integer) as String
Bur RokuKC, why not improve on that design, if it bene-fits? Like so, change the default to
-10:
function stri(intVal as Integer, radix = -10 as Integer) as String
And thus, calling stri with 2nd argument positive radix will give us unsigned representation and 10 will act as every other number in the 2..36 interval. Where calling w/o 2nd argument will give the signed decimal representation.
I personally think that additional options or APIs should be provided for more formatting control.
E.g. printf-like control over padding, width, alignment, precision; and separator/decimal formatting including locale-specific support.
That... that's "double trouble" 8-) . It both requires significant work and is mostly about
double type (or up-conversions thereof).
Where
unsigned int string representation is needed often in daily programming, so let's not leave it to a universal sprintf