Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

convert currency value to word in crystal report

$
0
0

hello,

please help me i check this formular. it convert the value to word sucessfully. but i am having problem with the NARRATION it show me this result bellow: im converting this value (1,051,316,298.35) and the result is:

ONE BILLION FIFTY-ONE MILLION THREE HUNDRED SIXTEEN THOUSAND TWO HUNDRED NINETY-EIGHT NAIRA AND THIRTY-FIVE KOBO.

and this is how i want it to display the result

ONE BILLION AND FIFTY-ONE MILLION THREE HUNDRED AND SIXTEEN THOUSAND TWO HUNDRED AND NINETY-EIGHT NAIRA THIRTY-FIVE KOBO.


And bellow are the formular that generate this Narration for me 


local stringvar isNumber:=cstr(Sum({DataTable1.NETPAY}));
local numbervar isWole:= ToNumber(Sum({DataTable1.NETPAY}));
local numbervar ispos:=instrrev(isNumber,'.');
local numbervar isdecimal:=0;
if ispos>0 then
(
isdecimal:=CDbl(right(isNumber,length(isNumber)-ispos));
);
if isdecimal<1 then

Uppercase(Towords(isWole,0)+ ' Naira Only')
else

Uppercase(Towords(isWole,0)+ ' Naira and ' + Towords(isdecimal,0)+' Kobo.');





Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>