on 2017 Jan 18 6:29 AM
This CReport code results a number into words ,how can i remove the decimal parts from this?If the number is 5678.67 the output should be "Five Thousand six hundred and seventy eight" .
numbervar RmVal:=0; numbervar Amt:=0; numbervar pAmt:=0; stringvar InWords :=""; Amt:= sum({Command.Value}); if Amt > 10000000 then RmVal := truncate(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; RmVal :=0; if Amt > 100000 then RmVal := truncate(Amt/100000); if Amt = 100000 then RmVal := 1; if RmVal >=1 then InWords := InWords + " " + towords(RmVal,0) + " Lakhs"; Amt := Amt - Rmval * 100000; RmVal :=0; if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0); pAmt := (Amt - truncate(Amt)) * 100; if pAmt > 0 then InWords := Propercase(InWords + " and " + towords(pAmt,0) + " Paisa only") else InWords := propercase(InWords + " Only");
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi
Int(1.22) will display 1.00 , so you can even use int(),
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please be a member in my whatsapp group for SAP Support.
User | Count |
---|---|
86 | |
11 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.