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 8th November 2016, 07:00
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
no to words
Baan: Other/Unknown
C/S: None/Unknown

how to convert no to words
Reply With Quote
Sponsored Links
  #2  
Old 8th November 2016, 07:37
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
You can use standard dll,

tcmcs.dll0006.decode()
__________________
Regards,
Sachin

TO DREAM THE PERSON U WOULD LIKE 2 B, IS 2 WASTE THE PERSON U R.
Reply With Quote
  #3  
Old 8th November 2016, 11:45
baanhp's Avatar
baanhp baanhp is offline
Member
 
Join Date: Dec 2009
Posts: 69
baanhp is on a distinguished road
Baan: Ln - DB: sql2000 - OS: windows server 2003
function decode.amount()
{
tcmcs.dll0006.decode(order.total, false, amount.desc,
amount.desc1,amount.desc2,amount.desc3)

add.indian.decimals()
if isspace(amount.desc3) and
isspace(amount.desc2) then
|* Only one line of amount description.
amount.desc1 = shiftr$(amount.desc1)
amount.desc1 = shiftl$(amount.desc1)
else
if isspace(amount.desc3) then
|* Two lines of amount description.
amount.desc1 = shiftr$(amount.desc1)
amount.desc1 = shiftl$(amount.desc1)
amount.desc2 = shiftr$(amount.desc2)
amount.desc2 = shiftl$(amount.desc2)
amount.desc2 = toupper$(amount.desc2)
else
|* Three lines of amount description.
amount.desc1 = shiftr$(amount.desc1)
amount.desc1 = shiftl$(amount.desc1)
amount.desc2 = shiftr$(amount.desc2)
amount.desc2 = shiftl$(amount.desc2)
amount.desc2 = toupper$(amount.desc2)
amount.desc3 = shiftr$(amount.desc3)
amount.desc3 = shiftl$(amount.desc3)
amount.desc3 = toupper$(amount.desc3)
endif
endif
amount.desc1 = toupper$(amount.desc1)
}

function add.indian.decimals()
{
long dec.part
double dec.amount

string decimal.desc(65)

|* Get cheque amount decimal part.
dec.part = round((order.total * 100) \ 100,0,1)
dec.amount = dec.part * 1.0

|* Decode decimal part to words.
if (dec.part = 0) then
|* Decimal part is zero.
decimal.desc = ""
else
tcmcs.dll0006.decode(dec.amount, false, idec.desc,
idec.desc1,idec.desc2, idec.desc3)
decimal.desc = " and PAISA " & trim$(idec.desc)
endif

|* Add decimal part to amount description and break into 3 parts.
full.desc = trim$(amount.desc) & " " & trim$(decimal.desc) & " ONLY"

| message("amount.desc1 %s",amount.desc1)
amount.desc2 = trim$(amount.desc2)
amount.desc1 = trim$(amount.desc1)
break.string.55(full.desc, amount.desc1, amount.desc2, amount.desc3)


| message("amount.desc1 %s",amount.desc1)
amount.desc1 = toupper$(amount.desc1)
amount.desc2 = toupper$(amount.desc2)
final.amount = trim$(amount.desc1) & " " & trim$(amount.desc2)

| message("full.desc %s",full.desc)

}

function break.string.55( domain tcmcs.str215m decode0,
ref domain tcmcs.st65m decode1,
ref domain tcmcs.st65m decode2,
ref domain tcmcs.st65m decode3)
{
|* This function will break the string decode0 into 2 other strings decode1
|* decode2 and decode3 if there is a space between them. This space should be
|* between the 1st and the 55th position

domain tcmcs.long digit
domain tcmcs.s130m hold.decode0
domain tcmcs.long code.len

|******************************************************************************
|* An asterisk is placed at the beginning and end of the decode1 string in the
|* calling procedure, so two spaces must be reserved for them.
|******************************************************************************
digit = 53

decode0 = trim$(decode0)
decode1 = ""
decode2 = ""
decode3 = ""

|* Decode first string.
code.len = len(decode0)
if (digit >= code.len) then
|* Full description will fit into first string.
decode1 = decode0
return
endif

while digit > 0
if isspace(decode0(digit; 1)) then
decode1 = decode0(1; digit)
hold.decode0 = decode0(digit + 1; code.len - digit)
digit = 1
endif
digit = digit - 1
endwhile

|* Decode second and third strings.
digit = 53
code.len = len(hold.decode0)
if (digit >= code.len) then
|* Remaining description will fit into second string.
decode2 = hold.decode0
return
endif

while digit > 0
if isspace(hold.decode0(digit; 1)) then
decode2 = hold.decode0(1; digit)
decode3 = hold.decode0(digit + 1; code.len - digit)
digit = 1
endif
digit = digit - 1
endwhile

|* Break by length if there is no space in the decode0.
if not isspace(decode0) and
isspace(decode1) and
isspace(decode2) and
isspace(decode3) then
code.len = len(decode0)
if (code.len < 54) then
|* Full description will fit into first string.
decode1 = decode0
return
else
if (code.len < 107) then
|* Full description will fit into first two strings.
decode1 = decode0(1; 53)
decode2 = decode0(54; code.len - 53)
else
|* All three strings are needed.
decode1 = decode0(1; 53)
decode2 = decode0(54; 53)
decode3 = decode0(107; code.len - 106)
endif
endif
endif

}
Reply With Quote
  #4  
Old 11th November 2016, 07:35
sameer.don's Avatar
sameer.don sameer.don is offline
Senior Member
 
Join Date: Oct 2008
Posts: 104
sameer.don is on a distinguished road
Baan: Baan IV, Baan ERP, BaaN ERP (B50C) - DB: MS SQL 2000, Oracle, Informix - OS: Windows 2003, Unix
Use this if you have simpler requirement.

str$()

Syntax

string str$( num_expr )
Description

This converts an integer or floating point expression to a string.

Quote:
Originally Posted by ncgjiju View Post
how to convert no to words
Reply With Quote
  #5  
Old 14th November 2016, 07:42
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Yes as described by other members here.

This is the Usage of the dll

Code:
tcmcs.dll0006.decode(tot.debit.amnt,1,report.amount,decode1,decode2,decode3,test)
Where tot.debit.amnt is the amount and report.amount is in words and rest of the parameters are string which you can just declare and use otherwise you would face an error.

what i found is that the decimal part in words i couldnt get so i wrote the function myself.
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
Wrapping of text by words fionad Tools Administration & Installation 1 24th January 2012 15:28
how to Convert Nominal in words Beniabdullah Tools Development 4 20th February 2006 09:44
number to words ncgjiju Tools Development 7 27th May 2005 13:37
Figures to words with 3 decimal places tin2210 Tools Development 6 21st August 2003 09:04


All times are GMT +2. The time now is 02:07.


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