lcPokok = [Satu ,Dua ,Tiga ,Empat ,Lima ,Enam ,Tujuh ,;
Delapan ,Sembilan ,Sepuluh ,Sebelas ]
DO CASE
CASE BETWEEN(tnNum, 0, 11)
lcTerbilang = GETWORDNUM(lcPokok, tnNum ,",")
CASE tnNum <= 20 && BETWEEN(tnNum, 12, 19)
lcTerbilang = GETWORDNUM(lcPokok, (tnNum % 10) ,",") + "Belas"
CASE tnNum < 100 && BETWEEN(tnNum, 20, 99)
lcTerbilang = GETWORDNUM(lcPokok, INT(tnNum / 10) ,",") + "Puluh " +;
GETWORDNUM(lcPokok, (tnNum % 10) ,",")
CASE tnNum < 200 && BETWEEN(tnNum, 100, 199)
lcTerbilang = "Seratus " + Terbilang(tnNum - 100)
CASE tnNum < 1000 && BETWEEN(tnNum, 200, 999)
lcTerbilang = Terbilang(INT(tnNum/100)) +"Ratus " + Terbilang(tnNum % 100)
CASE tnNum < 2000 && BETWEEN(tnNum, 1000, 1999)
lcTerbilang = "Seribu " + Terbilang(tnNum - 1000)
CASE tnNum < 1000000 && BETWEEN(tnNum, 2000, 999999)
lcTerbilang = Terbilang(INT(tnNum/1000)) +"Ribu " + Terbilang(tnNum % 1000)
CASE tnNum < 1e9 && BETWEEN(tnNum, 1000000, 999999999)
lcTerbilang = Terbilang(INT(tnNum/1000000)) +"Juta " + Terbilang(tnNum % 1000000)
CASE tnNum < 1e12
lcTerbilang = Terbilang(INT(tnNum/1e9)) +"Milyar " + Terbilang(tnNum % 1e9)
CASE tnNum < 1e15
lcTerbilang = Terbilang(INT(tnNum/1e12)) +"Triliun " + Terbilang(tnNum % 1e12)
CASE tnNum < 1e18
lcTerbilang = Terbilang(INT(tnNum/1e15)) +"Quadriliun " + Terbilang(tnNum % 1e15)
CASE tnNum < 1e21
lcTerbilang = Terbilang(INT(tnNum/1e18)) +"Pentaliun " + Terbilang(tnNum % 1e18)
ENDCASE
RETURN lcTerbilang
Tidak ada komentar:
Posting Komentar