It seems there is no way to convert Double to string without undue loss of precision:
Brightscript Debugger> dbl = 1.23456789D-12: ? type(dbl), dbl
Double 1.23456789e-12
Brightscript Debugger> ? dbl.toStr(), box(dbl).toStr(), str(dbl)
1.23457e-12 1.23457e-12 1.234568e-12
Brightscript Debugger> ? formatJson(dbl)
1.23457e-12
Not sure what the exact reason is, seems as if it gets piped into a Float first. I event tried a
RokuKC-suggested hack with formatJSON() to no cigar. "Print" does it just fine, why can't the other stringifiers?!
PS. It can get weirder too:
Brightscript Debugger> d = 1.234567890123456789d+40: ? d
1.2345678901235e+40
Brightscript Debugger> ? d.toStr(), str(d), formatJson(d)
1.23457e+40 inf 1.23456789e+40