tin2210
19th August 2003, 17:25
Hi All,
The standard Baan software has the provision to convert figures into words - but only has provision for 2 decimal places. In Oman 3 decimal places are used for amounts.
Does anyone have a script that takes care of printing 3 decimal places in the figures to words conversion?
Thanks
lakoon
20th August 2003, 11:14
Hi,
have a look at the edit$(expression, string format(.)) command.
/lakoon
tin2210
20th August 2003, 11:58
Hi lakoon,
With the edit$() function one can only format the display properties of the expression.
My question was specific to the DLL that converts an amount in figures to it's description in words, an example:
2134.97 gets converted to *TWO THOUSAND ONE HUNDRED THIRTY FOUR 97/100*
As seen the decimals shown are for 2 places only.
In Oman, the currency format has 3 decimal places (2134.978). I need to know if there exists any script that can convert figures to words taking care of the 3 decimal places. The final description should look like this:
*TWO THOUSAND ONE HUNDRED THIRTY FOUR 978/1000*
lakoon
20th August 2003, 13:57
sorry,
which standard session / dll is converting the figures to words?
/lakoon
estotz
21st August 2003, 00:45
The functions that convert the numbers to words are in the include function that is linked to the check report. The functions are in tfcmg0005 (Baan IV .. not sure what the include is for BaanERP).
Simply edit those functions and modify the last part to take the remainder of the amount ... i.e amount * 1000 \ 1000. That will give you the cents amount. Then format it as you need to with the appropriate thousandth fraction.
jmathew
21st August 2003, 08:54
Hi,
We had the same problem for cheque printing from figures to words with 3 decimals. We have solved this by the following coding which is doing fine in Baan IV c4. Hope this will be of help to you;
function decode.amount()
{
itfcmg0005.decode(amount, false, amount.desc, amount.desc1, amount.desc2, amount.desc3)
add.decimals()
if isspace(amount.desc2) then
amount.desc1 = shiftr$(amount.desc1) &" only"
amount.desc1 = shiftl$(amount.desc1)
else
amount.desc1 = shiftr$(amount.desc1) & "*"
amount.desc2 = shiftr$(amount.desc2) & " only"
amount.desc2 = shiftl$(amount.desc2)
endif
amount.desc1 = toupper$(amount.desc1)
amount.desc2 = toupper$(amount.desc2)
}
function add.decimals()
{
long dec.part
string decimal.desc(18)
dec.part = round((amount * 1000) \ 1000,0,1)
if dec.part > 1 then
if amount > 1 then
decimal.desc = " " & form.text$("tfcmgs0187") & " "
& "FILS " & edit$(dec.part, "999") & "/1000"
else
decimal.desc = "FILS " & edit$(dec.part, "999") & "/1000"
endif
amount.desc = strip$(amount.desc) &""&decimal.desc
endif
itfcmg0005.break.the.string(amount.desc, amount.desc1, amount.desc2)
}
Regards,
John.
Andreas
21st August 2003, 10:04
In Baan 5.0c the function for decoding is located in tcmcsdll006