Live Webinar: Prompt Engineering: Skill Everyone Must Learn Today
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to convert Amount in Words using Crystal Report?
WhatsApp
Pintoo Yadav
Apr 29
2015
15.9
k
0
1
How to Convert Amount (Currency) in words directly on Crystal Report. Just Simply copy paste below code in your function. To Create function follow the steps given below: i) go to Field Explorer ii) right click on Formula Fields click on New give specific name iii) Formula Editor window will open just paste the Code given below iv) Save & Close... v) Just drag the Field to your specific required Location that done.
numbervar RmVal: = 0;
currencyVar Amt: = 0;
numbervar pAmt: = 0;
stringvar InWords: =
"Rupees "
;
Amt: = ({
vwCostTypes.UnitCost
});
if
Amt > 10000000 then RmVal: = truncate(ToNumber(Amt) / 10000000);
if
Amt = 10000000 then RmVal: = 1;
if
RmVal = 1 then InWords: = InWords +
" "
+ towords(RmVal, 0) +
" crore"
else
if
RmVal > 1 then InWords: = InWords +
" "
+ towords(RmVal, 0) +
" crores"
;
Amt: = Amt - Rmval * 10000000;
if
Amt > 100000 then RmVal: = truncate(ToNumber(Amt) / 100000);
if
Amt = 100000 then RmVal: = 1;
if
RmVal >= 1 then InWords: = InWords +
" "
+ towords(RmVal, 0) +
" lakhs"
;
Amt: = Amt - Rmval * 100000;
if
Amt > 0 then InWords: = InWords +
" "
+ towords(truncate(Amt), 0);
pAmt: = (ToNumber(Amt) - truncate(ToNumber(Amt))) * 100;
if
pAmt > 0 then InWords: = InWords +
" and "
+ towords(pAmt, 0) +
" paisa only"
else
InWords: = InWords +
" only"
;
UPPERCASE(InWords)
Convert amount in words
Crystal Reports in C#
Up Next
How to convert Amount in Words using Crystal Report?