Avatar

building a cost control system with Basic-256 (New Features)

by DickStomp2 @, NL- SASSENHEIM, Sunday, February 22, 2015, 07:48 (1029 days ago) @ DickStomp2

And here is the INCLUDE-member: editnum.kbs

# EDITNUM
# omzetten van een bedrag voor afdrukken
# formatting a sum for printing
# invoer decimaal getal van maximaal 10 cijfers
# input decimal number of maximum 10 digits
# uitvoer een string van 11 posities
# output a string of 11 positions
# wordt aangeroepen met call editnum(ref(getal),ref(bedrag$))
# is called with call editnum(ref(number),ref(sum$))
# subroutine editnum(ref(getal),ref(bedrag$))
# subroutine editnum(ref(number),ref(sum$))
# next two lines for testing
#getal = -12345.678
#print getal for testing
I = int(getal)
#print I
I$ = right(" "+string(I),8)
#print I$
D = (getal - I) * 100
if D < 1 then
D = D * -1
end if
#print D
D$ = left(string(D)+"00",2)
#print D$
bedrag$ = I$ + "." + D$
#print bedrag$
end subroutine


Complete thread:

 RSS Feed of thread

powered by my little forum