Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

powerbuilder convert integer to string

Posted on 2009-04-02
2
Medium Priority
?
9,864 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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…
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 new code templates in NetBeans IDE 8.0 for Windows.

609 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