Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 27th May 2005, 10:30
ncgjiju's Avatar
ncgjiju ncgjiju is offline
Member
 
Join Date: Jan 2005
Location: Singapore
Posts: 73
ncgjiju is on a distinguished road
Baan: BAAN VC, Triton & Baan IV - DB: informix,sql server 200 - OS: hp UNIX 11, Windows
number to words

Is there any function in baan that convert numbers to words . What is the best way to convert numbers to words. Please advise.


regards,

George
Reply With Quote
Sponsored Links
  #2  
Old 27th May 2005, 10:58
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
Hi,

U have to write the code accourding to ur requirement. if u need the code i can provide the same.



Regards
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
  #3  
Old 27th May 2005, 11:43
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 566
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hi,

in IVc4 you can have a look to the amount to words routine in function tfcmg0005 (Decode amount). Don`t know if something similar is available for newer Baan versions.

Juergen
Reply With Quote
  #4  
Old 27th May 2005, 11:55
ncgjiju's Avatar
ncgjiju ncgjiju is offline
Member
 
Join Date: Jan 2005
Location: Singapore
Posts: 73
ncgjiju is on a distinguished road
Baan: BAAN VC, Triton & Baan IV - DB: informix,sql server 200 - OS: hp UNIX 11, Windows
Hi Deb ,

Could please give me the code?. Thanks for your help.

regards,

George
Reply With Quote
  #5  
Old 27th May 2005, 12:18
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Cheque

Hi,

for usage example of this fuction look into the Cheque (or is it Check?) report.
__________________
May the force be with you!
Reply With Quote
  #6  
Old 27th May 2005, 12:56
ncgjiju's Avatar
ncgjiju ncgjiju is offline
Member
 
Join Date: Jan 2005
Location: Singapore
Posts: 73
ncgjiju is on a distinguished road
Baan: BAAN VC, Triton & Baan IV - DB: informix,sql server 200 - OS: hp UNIX 11, Windows
not for cheque

It is for printing customised report in baan
Reply With Quote
  #7  
Old 27th May 2005, 13:16
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
|This is the code for converting make it function and call from session


string itdind0003.desc(15,13)

function itdind0003.decode ( domain tfgld.amnt amount,
domain tcbool decimals,
ref domain tcmcs.s130m decode0,
ref domain tcmcs.st65m decode1,
ref domain tcmcs.st65m decode2,
ref domain tcmcs.st20m decode3)
{
string decode.hundred(15)
string decode.thousand(15)
string decode.lacs(15)
string decode.crore(15)
string decode.paise(15)
string decode.and(15)
string amount.str(14)

decode0 = ""
decode1 = ""
decode2 = ""
decode3 = ""
if amount = 0 then
decode0 = form.text$("tfcmgs0158") |"zero"
else
decode.hundred = ""
decode.thousand = ""
decode.lacs = ""
decode.crore = ""
decode.paise = ""
decode.and = ""
e = set.mem(itdind0003.desc,"")
amount.str = edit$(amount, "99999999999V99")
if not decimals then
amount.str(12;2) = "00"
endif
itdind0003.decode.procedure(amount.str,decode.hundred,
decode.thousand,decode.lacs,decode.crore,
decode.paise,decode.and)
itdind0003.form.a.string(decode.hundred,decode.thousand,
decode.lacs,decode.crore,
decode.paise,decode.and,decode0,decode3)
endif
decode0 = toupper$(shiftl$(decode0))
itdind0003.break.the.string(decode0,decode1,decode2)
decode1 = toupper$(shiftl$(decode1))
decode2 = toupper$(shiftl$(decode2))
decode3 = toupper$(shiftl$(decode3))
}

|++++++++++++++++++++++++++ decode procedure +++++++++++++++++++++++++++

function itdind0003.decode.procedure( string amount.str(14),
ref string decode.hundred(),
ref string decode.thousand(),
ref string decode.lacs(),
ref string decode.crore(),
ref string decode.paise(),
ref string decode.and())
{
long digit
long positions
long mult
long number

digit = 1
while digit < 14
positions = 1
mult = 1
if (digit = 3 or digit = 5 or digit = 7 or digit = 10 or
digit = 12) and val(amount.str(digit;1)) <> 0 then
if val(amount.str(digit;1)) = 1 then
positions = 2
else
mult = 10
endif
endif
number = val(amount.str(digit;positions)) * mult
if number > 0 then
itdind0003.search.desc(number,digit)
endif
digit = digit + positions
endwhile
decode.hundred = form.text$("tfcmgs0186") |"hundred"
decode.thousand = form.text$("tfcmgs0188") |"thousand"
decode.lacs = form.text$("tdinds0101") |"lacs"
decode.crore = form.text$("tdinds0102") |"crore"
decode.paise = form.text$("tdinds0103") |"paise"
if language$ <> "2" and language$ <> "u" then
decode.and = form.text$("tfcmgs0187") |"and"
endif
}

function itdind0003.search.desc(long number,
long digit)
{
on case number

case 1:
itdind0003.desc(1,digit) = form.text$("tfcmgs0159")
break
case 2:
itdind0003.desc(1,digit) = form.text$("tfcmgs0160")
break
case 3:
itdind0003.desc(1,digit) = form.text$("tfcmgs0161")
break
case 4:
itdind0003.desc(1,digit) = form.text$("tfcmgs0162")
break
case 5:
itdind0003.desc(1,digit) = form.text$("tfcmgs0163")
break
case 6:
itdind0003.desc(1,digit) = form.text$("tfcmgs0164")
break
case 7:
itdind0003.desc(1,digit) = form.text$("tfcmgs0165")
break
case 8:
itdind0003.desc(1,digit) = form.text$("tfcmgs0166")
break
case 9:
itdind0003.desc(1,digit) = form.text$("tfcmgs0167")
break
case 10:
itdind0003.desc(1,digit) = form.text$("tfcmgs0168")
break
case 11:
itdind0003.desc(1,digit) = form.text$("tfcmgs0169")
break
case 12:
itdind0003.desc(1,digit) = form.text$("tfcmgs0170")
break
case 13:
itdind0003.desc(1,digit) = form.text$("tfcmgs0171")
break
case 14:
itdind0003.desc(1,digit) = form.text$("tfcmgs0172")
break
case 15:
itdind0003.desc(1,digit) = form.text$("tfcmgs0173")
break
case 16:
itdind0003.desc(1,digit) = form.text$("tfcmgs0174")
break
case 17:
itdind0003.desc(1,digit) = form.text$("tfcmgs0175")
break
case 18:
itdind0003.desc(1,digit) = form.text$("tfcmgs0176")
break
case 19:
itdind0003.desc(1,digit) = form.text$("tfcmgs0177")
break
case 20:
itdind0003.desc(1,digit) = form.text$("tfcmgs0178")
break
case 30:
itdind0003.desc(1,digit) = form.text$("tfcmgs0179")
break
case 40:
itdind0003.desc(1,digit) = form.text$("tfcmgs0180")
break
case 50:
itdind0003.desc(1,digit) = form.text$("tfcmgs0181")
break
case 60:
itdind0003.desc(1,digit) = form.text$("tfcmgs0182")
break
case 70:
itdind0003.desc(1,digit) = form.text$("tfcmgs0183")
break
case 80:
itdind0003.desc(1,digit) = form.text$("tfcmgs0184")
break
case 90:
itdind0003.desc(1,digit) = form.text$("tfcmgs0185")
break
default:
endcase
}

|++++++++++++++++++++++++++ form string +++++++++++++++++++++++++++

function itdind0003.form.a.string( string decode.hundred(15),
string decode.thousand(15),
string decode.lacs(15),
string decode.crore(15),
string decode.paise(15),
string decode.and(15),
ref domain tcmcs.s130m decode0,
ref domain tcmcs.st20m decode3)
{
long digit
long positions

digit = 1
while digit < 14
positions = 1
if digit = 1 or digit = 5 or digit = 7 or digit = 10 then
decode0 = itdind0003.process.10s(digit,decode0,
decode.and)
decode0 = itdind0003.lacs.thou(digit,decode.thousand,
decode.lacs,decode.crore,decode0)
positions = 2
endif
if (digit = 2 or digit = 9) and not isspace(
itdind0003.desc(1,digit)) then
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit)) & " " &
strip$(decode.hundred)
endif
if digit = 4 then
if not isspace(itdind0003.desc(1,digit)) then
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit))& " " &
strip$(decode.crore)
else
if not isspace(itdind0003.desc(1,digit-1)) or
not isspace(itdind0003.desc(1,digit-2)) or
not isspace(itdind0003.desc(1,digit-3)) then
decode0 = strip$(decode0) & " " &
strip$(decode.crore)
endif
endif
endif
if (digit = 3) then
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit))
endif
if digit = 12 then
decode3 = itdind0003.process.decimals(digit,
decode.and,decode.paise,decode3)
positions = 2
endif
if digit = 1
then
digit = digit + 1
else
digit = digit + positions
endif
endwhile
}

function domain tcmcs.s130m itdind0003.process.10s( long digit,
domain tcmcs.s130m decode0,
string decode.and(15))
{
if isspace(itdind0003.desc(1,digit)) or isspace(itdind0003.desc(1,digit
+ 1)) then
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit)) &
strip$(itdind0003.desc(1,digit + 1))
if digit = 1 and not isspace(itdind0003.desc(1,2)) then
decode0 = " "
endif
else
if language$ = "2" or language$ = "u" then
if digit = 1 and not isspace(itdind0003.desc(1,2)) then
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit + 1))
else
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit)) & " " &
strip$(itdind0003.desc(1,digit + 1))
endif
else
decode0 = strip$(decode0) & " " &
strip$(itdind0003.desc(1,digit + 1)) & " " &
strip$(decode.and) & " " &
strip$(itdind0003.desc(1,digit))
endif
endif
return(decode0)
}

function domain tcmcs.s130m itdind0003.lacs.thou( long digit,
string decode.thousand(15),
string decode.lacs(15),
string decode.crore(15),
domain tcmcs.s130m decode0)
{
if digit = 1 and not isspace(itdind0003.desc(1,digit)) then
decode0 = strip$(decode0) & " " & strip$(decode.thousand)
endif
if digit = 7 and (not isspace(itdind0003.desc(1,digit)) or
not isspace(itdind0003.desc(1,digit + 1))) then
decode0 = strip$(decode0) & " " &
strip$(decode.thousand)
endif
if digit = 5 and not isspace(itdind0003.desc(1,digit)) then
decode0 = strip$(decode0) & " " &
strip$(decode.lacs)
else
if digit = 5 and not isspace(itdind0003.desc(1,digit+1)) then
decode0 = strip$(decode0) & " " &
strip$(decode.lacs)
endif
endif
return(decode0)
}

function domain tcmcs.st20m itdind0003.process.decimals(long digit,
string decode.and(15),
string decode.paise(15),
ref domain tcmcs.st20m decode3)
{
if isspace(itdind0003.desc(1,digit)) or isspace(itdind0003.desc(1,digit
+ 1)) then
decode3 = strip$(decode3) & " " &
strip$(decode.paise) & " " &
strip$(itdind0003.desc(1,digit)) &
strip$(itdind0003.desc(1,digit + 1))
else
if language$ = "2" or language$ = "u" then
decode3 = strip$(decode3) & " " &
strip$(decode.paise) & " " &
strip$(itdind0003.desc(1,digit)) & " " &
strip$(itdind0003.desc(1,digit + 1))
else
decode3 = strip$(decode3) & " " &
strip$(itdind0003.desc(1,digit + 1)) &
" " & strip$(decode.and) & " " &
strip$(itdind0003.desc(1,digit))
endif
endif
if isspace(itdind0003.desc(1,digit)) and
isspace(itdind0003.desc(1,digit+1)) then
decode3 = " "
endif
return(decode3)
}

function itdind0003.break.the.string( domain tcmcs.s130m decode0,
ref domain tcmcs.st65m decode1,
ref domain tcmcs.st65m decode2)
{
long digit

digit = 65
while digit > 0
if isspace(decode0(digit;1)) then
decode1 = decode0(1;digit)
decode2 = decode0(digit;65)
digit = 1
endif
digit = digit - 1
endwhile
}

********
** How to use this code if script

extern domain bssrt60 amt1,amt2,amt3

itdind0003.decode(abs(amount),true,amt1,amt2,amt3)

**********

Hope it will work for u
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
  #8  
Old 27th May 2005, 13:37
darpan's Avatar
darpan darpan is offline
Senior Member
 
Join Date: Mar 2005
Location: Chennai
Posts: 114
darpan is on a distinguished road
Baan: Baan IV, Infor LN - DB: oracle 10g, Oracle 9i - OS: AIX, Windows server 2003
We can call this function and the work will be done

#include "itcmcs0010" | Calculate and Round Functions

tccom.dllc001.decode (total_amnt,true,decode0,decode1,decode2,decode3)

extern domain tcmcs.st20m decode3
extern domain tcmcs.s130m decode0
extern domain tcmcs.st65m decode1
extern domain tcmcs.st65m decode2

decode0 = ""
decode1 = ""
decode2 = ""
decode3 = ""

It should work instead of tha big code

Regards

Darpan Bhansali
91-9312491353
New Delhi
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Next Available First Free Number kclewley Archiving & Multisite 4 27th May 2005 13:48
warehouse order number vishbaan Distribution, Transportation & Warehousing 7 31st March 2004 20:30
conversion of number into words novicebaan Tools Development 11 17th June 2003 07:42
Lot Number Vs Receipt Number in BaaN IV C4 Abuibra Distribution, Transportation & Warehousing 2 11th October 2002 17:22


All times are GMT +2. The time now is 13:26.


©2001-2017 - Baanboard.com - Baanforums.com