on 10-13-2021 10:18 AM
Dear Experts,
I am getting the error in my crystal report formula, mentioned in my formula below.
I have to exclude the and zero from my crystal result.
Formula : numbervar x := {@TotalInvoiceAmount}; numbervar ipart; numberVar decpart; ipart := int(x); decpart := x - ipart; Propercase(Replace(towords(ipart)," and xx / 100",""))& " only" & if decpart = 0 then "" else " and "& Propercase(Replace(towords(decpart)," and xx / 100","")) &" only ";
Result: Ten Thousand Five Hundred One and Zero And 69 / 100 only
Thanks, Jody
It's working fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't use an If statement in the middle of building a string. I suggest creating a new string variable that will handle the "if" part of your logic. It will look something like this:
numbervar x := {@TotalInvoiceAmount};
numbervar ipart;
numberVar decpart;
stringvar endwords = " only";
ipart := int(x);
decpart := x - ipart;
if decpart <> 0 then and := " and " & Propercase(Replace(towords(decpart)," and xx / 100","")) &
" only ";
Propercase(Replace(towords(ipart)," and xx / 100",""))& endwords;
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.