Solved

powerbuilder convert integer to string

Posted on 2009-04-02
2
8,709 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

777 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