*!*	Function SUMA_IN_VORBE
Parameter tnSuma
Local i,lit,numar1,numar2
Store 0 To i,j,lnSuma,lnSuma2
Store 1 To putere
Store '' To lit,numar1,numar2
If Used('mila1')
	Use In mila1
Endif
Use mila1 In 0 Shared

lnSuma=Round(tnSuma,2)
lnSuma2=(lnSuma-Int(lnSuma))*100
lnSuma=Int(lnSuma)

*!*	lnSuma=ROUND(lnSuma,gnPa)
*!*	FOR j=1 TO gnPa
*!*		putere=10*putere
*!*	ENDFOR
*!*	lnSuma2=(lnSuma-Int(lnSuma))*putere

numar1=Space(12)
*!*	numar2=Space(gnPa)
numar2=Space(2)

numar1=Str(lnSuma,12)
*!*	numar2=Str(lnSuma2,gnPa)
numar2=Str(lnSuma2,2)

Dimension A(12)
A(1)=Subs(numar1,12,1)
A(2)=Subs(numar1,11,1)
A(3)=Subs(numar1,10,1)
A(4)=Subs(numar1,9,1)
A(5)=Subs(numar1,8,1)
A(6)=Subs(numar1,7,1)
A(7)=Subs(numar1,6,1)
A(8)=Subs(numar1,5,1)
A(9)=Subs(numar1,4,1)
A(10)=Subs(numar1,3,1)
A(11)=Subs(numar1,2,1)
A(12)=Subs(numar1,1,1)
Sele mila1
*********************
Loca For NR=Val(A(12))
lit=lit+Alltri(cr1)

If Val(A(11))=1
	If Val(A(10))=0
		Loca For NR=Val(A(11))
		lit=lit+Alltri(cr5)
	Else
		Loca For NR=Val(A(10))
		lit=lit+Alltri(cr4)
	Endif
Else
	If Val(A(10))=0
		Loca For NR=Val(A(11))
		lit=lit+Alltrim(cr5)
	Else
		Loca For NR=Val(A(11))
		lit=lit+Alltrim(cr2)
		Loca For NR=Val(A(10))
		lit=lit+Alltrim(cr3)
	Endif
Endif
Do Case
Case Val(A(12)) # 0
	lit=lit+' miliarde'
Case Val(A(11)) # 0
	lit=lit+' miliarde'
Case Val(A(10)) # 0
	lit=lit+' miliarde'
Endcase
***********************
Loca For NR=Val(A(9))
lit=lit+Alltri(cr1)

If Val(A(8))=1
	If Val(A(7))=0
		Loca For NR=Val(A(8))
		lit=lit+Alltri(cr5)
	Else
		Loca For NR=Val(A(7))
		lit=lit+Alltri(cr4)
	Endif
Else
	If Val(A(7))=0
		Loca For NR=Val(A(8))
		lit=lit+Alltrim(cr5)
	Else
		Loca For NR=Val(A(8))
		lit=lit+Alltrim(cr2)
		Loca For NR=Val(A(7))
		lit=lit+Alltrim(cr3)
	Endif
Endif
Do Case
Case Val(A(9)) # 0
	lit=lit+' milioane'
Case Val(A(8)) # 0
	lit=lit+' milioane'
Case Val(A(7)) # 0
	lit=lit+' milioane'
Endcase
***********************
Loca For NR=Val(A(6))
lit=lit+Alltri(cr1)

If Val(A(5))=1
	If Val(A(4))=0
		Loca For NR=Val(A(5))
		lit=lit+Alltri(cr5)
	Else
		Loca For NR=Val(A(4))
		lit=lit+Alltri(cr4)
	Endif
Else
	If Val(A(4))=0
		Loca For NR=Val(A(5))
		lit=lit+Alltrim(cr5)
	Else
		Loca For NR=Val(A(5))
		lit=lit+Alltrim(cr2)
		Loca For NR=Val(A(4))
		lit=lit+Alltrim(cr3)
	Endif
Endif
Do Case
Case Val(A(6)) # 0
	lit=lit+' mii'
Case Val(A(5)) # 0
	lit=lit+' mii'
Case Val(A(4)) # 0
	lit=lit+' mii'
Endcase

*********************
Loca For NR=Val(A(3))
lit=lit+Alltri(cr1)

If Val(A(2))=1
	If Val(A(1))=0
		Loca For NR=Val(A(2))
		lit=lit+Alltri(cr5)
	Else
		Loca For NR=Val(A(1))
		lit=lit+Alltri(cr4)
	Endif
Else
	If Val(A(1))=0
		Loca For NR=Val(A(2))
		lit=lit+Alltrim(cr5)
	Else
		Loca For NR=Val(A(2))
		lit=lit+Alltrim(cr2)
		Loca For NR=Val(A(1))
		lit=lit+Alltrim(cr3)
	Endif
Endif
Do Case
Case Val(A(3)) # 0
	lit=lit+' lei'
Case Val(A(2)) # 0
	lit=lit+' lei'
Case Val(A(1)) # 0
	lit=lit+' lei'
Endcase


*********************
Do Case
Case lnSuma2>1
	lit=lit+' si'
	Dimension B(2)
	B(1)=Subs(numar2,2,1)
	B(2)=Subs(numar2,1,1)

	Do Case
	Case Val(B(2))=1 And Val(B(1))!=0
		Loca For NR=Val(B(1))
		lit=lit+Alltri(cr4)
	Case Val(B(2))=0
		Loca For NR=Val(B(1))
		lit=lit+Alltrim(cr3)
	Case Val(B(1))=0
		Loca For NR=Val(B(2))
		lit=lit+Alltrim(cr5)
	Otherwise
		Loca For NR=Val(B(2))
		lit=lit+Alltrim(cr2)
		Loca For NR=Val(B(1))
		lit=lit+Alltrim(cr3)
	Endcase
	lit=lit+' bani'
Case lnSuma2=1
	lit=lit+'si un ban'
Endcase

Sele mila1
*!*	use

lit=Strtran(lit,' ','')
Use In mila1
Return lit