Numeric value in words (for Cheque printing)
Hi All,
To convert numeric value in words (for Cheque printing), I created two functions in Forms and reports 6i.
1) FUNCTION Spell (val number) RETURN CHAR IS
sp varchar2(100);
BEGIN
if val > 0 then
return(initcap(to_char(to_date(val, 'SSSSS'), 'SSSSSSP')));
else
return('');
end if;
END;
2) function SPELLED_AMOUNTFormula return Char is
cents number;
c_str varchar2(80);
val number;
begin
val := :p_instr_amt;
cents := (val mod 1) * 100;
if cents > 0 then --creates string for cents
c_str := ' and ' || spell(TO_CHAR(cents)) || ' fils Only';
else
c_str := ' Only';
end if;
if val < 1000 and val > 1 then
return (initcap(spell(floor(val))) || c_str);
elsif val > 1000 then
return(initcap(spell(floor(val/1000))) || ' Thousand ' ||
spell(floor(val mod 1000)) || c_str);
else
return('Zero'||c_str);
end if;
end;
This convert value up to thousands. How to convert the value more than 1 lac. please configure this code.
Thanks in advance