Solved

powerbuilder convert integer to string

Posted on 2009-04-02
2
9,143 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Object Data Source 4 141
error when doin maven update 2 126
Java eclipse error 2 77
Fast, free, private online code repository / editor 7 123
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…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

738 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