sameer
22nd February 2023, 18:55
How to convert amount 2510 to words - Two Thousand Five Hundred And Ten Only in customized session with tx package.

Mention the explanation, I have searched all similar threads and I cant understand them.:)

OmeLuuk
23rd February 2023, 16:20
Never came across a standard (tools) function that is capable of doing this, but after some odd 20+ years of development something new still can be found. Maybe tcmcsdll0006 can help you out...

tcmcs.dll0006.break.string

void tcmcs.dll0006.break.string( domain tcmcs.s130m i.amount.in.words.complete mb, ref domain tcmcs.st65m o.amount.in.words.part.1 mb, ref domain tcmcs.st65m o.amount.in.words.part.2 mb )

Expl. This function will break the string i.amount.in.words.complete
into 2 other strings: o.amount.in.words.part.1 and
o.amount.in.words.part.2. This is only done if there is a space
between them. This space should be between the 1st and the 65th
position.
Input i.amount.in.words.complete
Output o.amount.in.words.part.1
o.amount.in.words.part.2

tcmcs.dll0006.decode

void tcmcs.dll0006.decode( domain tcamnt i.amount, boolean i.decimals, ref domain tcmcs.s130m o.amount.in.words.complete mb, ref domain tcmcs.st65m o.amount.in.words.part.1 mb, ref domain tcmcs.st65m o.amount.in.words.part.2 mb, ref domain tcmcs.st65m o.amount.in.words.decimals mb, domain tclang i.system.language )

Expl.:
Pre: -
Post: -
Input: i.amount to be decoded, maximum 11+2
i.decimals required (boolean)
Output:
- o.amount.in.words.complete Decoded amount of 130 chrs.
- o.amount.in.words.part.1 Same decoded amount in two
- o.amount.in.words.part.2 strings of 65 chars
- o.amount.in.words.decimals Decode of the decimals

OmeLuuk
23rd February 2023, 16:44
Thanks for the new info!
function main(){
#pragma used dll "otcmcsdll0006"
domain tcamnt numeric_var
domain tcmcs.s130m output
domain tcmcs.st65m output1, output2, decimals

numeric_var = 2510.5
tcmcs.dll0006.decode(numeric_var, true, output, output1, output2, decimals, "2")
message(output & "\n" & output1 & " - " & output2 & "\n" & decimals)
}two thousand five hundred ten
two thousand five hundred ten -
50/100
OK

OmeLuuk
23rd February 2023, 17:21
Ah and specific for tx (cloud environment etc) refer to this trhead http://www.baanboard.com/baanboard/showthread.php?t=74667&highlight=ConvertAmountToWords