To convert amount in words and include the customer currency along with it.

To convert amount in words and include the customer currency along with it..

Created a custom field.

And enter the below given formula in the default value field. {currencysymbol} is the internal id of currency.

{currencysymbol} || ' ' || CASE WHEN {total}=0 THEN 'ZERO' ELSE TO_CHAR(TO_TIMESTAMP(LPAD(TRUNC({total}, 0), 9, '0'), 'FF9' ), 'FFSP') ||' ' || (CASE WHEN {total}-TRUNC({total}, 0) > 0 THEN ' AND ' || (CASE WHEN LENGTH(TO_CHAR(REGEXP_REPLACE({total}, '^[0-9]+.', ''))) = 1 THEN TO_CHAR(TO_DATE(TO_CHAR(TRUNC(REGEXP_REPLACE({total}, '^[0-9]+.', ''), 0)*10),'J'),'JSP')  ELSE TO_CHAR(TO_DATE(TO_CHAR(TRUNC(REGEXP_REPLACE({total}, '^[0-9]+.', ''), 0)),'J'),'JSP') END) ELSE ' ' END) || ' ' END

Leave a comment

Your email address will not be published. Required fields are marked *