Solved

powerbuilder convert integer to string

Posted on 2009-04-02
2
8,520 Views
Last Modified: 2013-12-26
i want to create a function let call it pic9 which will do the following action
 - it will have two integer values as argument (lets call it  numb, size)
 - it will return a string which will have length=size and it will contain numb right justified  and leading zeros in its rest bytes.

for example

numb     size          result
10             5            00010
10             2            10
10             4            0010
10             3            010
 
0
Comment
Question by:basilhs_s
2 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
ID: 24050326
FUNCTION : pic9(ai_num,ai_size)

integer i_len
string ls_num,ls_zeros,ls_return

li_len = ai_size - len(string(ai_num))
If li_len > 0 Then
   ls_zeros = Fill('0',li_len)
   ls_return = ls_zeros + string(li_num)
Else
   ls_return = string(li_num)
End If


Regards,
Sandeep
0
 

Author Closing Comment

by:basilhs_s
ID: 31565742
perfect and simple
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now