Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
for i = 1 to 10
|
||||
n = rnd(1) * 10 ^ (int(10 * rnd(1)) - 2)
|
||||
print "Raw number = "; n, "Using custom function = "; FormattedPrint$(n, 16, 5)
|
||||
next i
|
||||
end
|
||||
|
||||
function FormattedPrint$(n, length, decPlaces)
|
||||
format$ = "#."
|
||||
for i = 1 to decPlaces
|
||||
format$ = format$ + "#"
|
||||
next i
|
||||
|
||||
n$ = using(format$, n) ' remove leading spaces if less than 3 figs left of decimal
|
||||
' add leading zeros
|
||||
for i = 1 to len(n$)
|
||||
c$ = mid$(n$, i, 1)
|
||||
if c$ = " " or c$ = "%" then nn$ = nn$ + "0" else nn$ = nn$ + c$
|
||||
next i
|
||||
FormattedPrint$ = right$( "000000000000" +nn$, length) ' chop to required length
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue