on second look, the code doesn't look right
it's a bit messy to try and figure out, why don't you give the following a try
it's a bit messy to try and figure out, why don't you give the following a try
Code: (Select All)
Declare Library
Function sstr& Alias "snprintf" (Dest As String, Byval l As Long, frmt As String, Byval x As Single)
Function dstr& Alias "snprintf" (Dest As String, Byval l As Long, frmt As String, Byval x As Double)
End Declare
n! = .3123456!
dp% = 2
value$ = Spc(64) + Chr$(0)
frmt$ = "%." + _Trim$(Str$(dp%)) + "g" + Chr$(0)
ok& = sstr&(value$, 62, frmt$, n!)
Print value$