This might be a little simpler and a little faster depending on the internals of the compiler
Call it with either:
print using$(number, decimals)
or
text x,y, using$(number, decimals)
; n# is the number to convert
; dec is the number of decimal places wanted
Function using$(n#, dec)
s$ = Str$ n#
t$ = Left$(s$, Len(s$) - Instr(s$, ".")+ dec -1)
Return t$
End Function
Does anyone know the internals of Blitz3D enough to know if this sort of thing is faster or slower than calling a function in a DLL, assuming the function in the DLL is itself fairly effecient?
Or, maybe more to the point, is Blitz3D fast enough with little stuff like this that we don't have to care most of the time?
Barry
Call it with either:
print using$(number, decimals)
or
text x,y, using$(number, decimals)
; n# is the number to convert
; dec is the number of decimal places wanted
Function using$(n#, dec)
s$ = Str$ n#
t$ = Left$(s$, Len(s$) - Instr(s$, ".")+ dec -1)
Return t$
End Function
Does anyone know the internals of Blitz3D enough to know if this sort of thing is faster or slower than calling a function in a DLL, assuming the function in the DLL is itself fairly effecient?
Or, maybe more to the point, is Blitz3D fast enough with little stuff like this that we don't have to care most of the time?
Barry