I have a requirement in db.
1).Table ABC, column: check_amount number number(18,4)
. This basically contains check amount for eg. 3000.50 to be paid to an employee.
Now a cheque is issued and that check contains this check_amount in number as well as in text form.for eg.check will have:
pay to <emplyee_name> ****$3000.50**** ****THREE THOUSAND DOLLARS AND FIFTY CENTS****
I have to generate this text using DB column value and display that on check.
Can anybody help me out, how can i achieve this in oracle 11g ?
Hint:I have heard of Julien format, but that is not working. Any suggestions is greatly appreciated.
From Nalin
Since Julian format works only for whole numbers, you can separate the decimal parts and then apply the Julian format trick to the separated numbers. Here's a simple demo.
There is a limitation while using
Julian dates
,It ranges from1 to 5373484
. That’s why if you put the values after5373484
, it will throw you an error as shown below:To cater the above problem ,create a function ,and with little trick with j->jsp ,you can fetch the desired result.
Output:
One Hundred Twenty-Two trillion Three Hundred Forty-Four billion Three Hundred Forty-Three million Four Hundred Forty-Four thousand Four Hundred Forty-Four Dollars AND twenty-three Cents Blog Link