Solved

powerbuilder convert integer to string

Posted on 2009-04-02
2
8,311 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
Comment Utility
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
Comment Utility
perfect and simple
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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.

744 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

15 Experts available now in Live!

Get 1:1 Help Now