Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     leading zeros: integers to string

Read-Only Read-Only Topic
Go
Search
Notify
Tools
leading zeros: integers to string
 Login/Join
 
<bigpgo>
posted
Hello. I'm trying to print my integers as strings (because I want to concatenate them with the word " days"). So when I do:

COMPUTE temp/A12 = EDIT(numDays)| ' days';

my result looks like:

"00015 days" instead of "15 days". I tried making a temporary field in define, such as:

myNum/P7S = numDays;

and then putting that into EDIT. Still same leading zeros. Please help.
 
Report This Post
Platinum Member
posted Hide Post
You need to provide the Edit mask.
So if the integer is 2 digits and 3 leading zeros to ignor..
newvalue/A12=EDIT(NUMBER,'$$$99')|' Days');

where the $ are ignored, and the 9's are selected.
 
Posts: 226 | Registered: June 08, 2003Report This Post
Guru
posted Hide Post
Take a look at the TRIM function and its possible use on an intermediate variable.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
<bigpgo>
posted
Unfortunately, I cannot use the Mask - my number of days can vary from 1 to 7 digits long, and can also be negative.

TRIM function? Where can I find documentation for that? Thanks.
 
Report This Post
Silver Member
posted Hide Post
TRIM is a function and is located in the Using Functions manual.

If you don't have the manual, here's the syntax:
TRIM(trim_where, string, string_length, pattern, pattern_length,outfield)

Ex:
CTR/A3=TRIM('L',CTR2,3,'0',1,'A3');

trim_where (alphanumeric) = L for leading, T for trailing, B for both

string (alphanumeric) = source character string enclosd in single quotes, or the field containing the string

string_length (integer) = length of string in characters

pattern (alphanumeric) = pattern to remove enclosed in single quotes

pattern_length (integer) = number of characters in pattern

outfield (alphanumeric) = field where the result is returned, or the format of the ouput value enclosed in single quotes

Hope this helps.

Raelene
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Report This Post
Expert
posted Hide Post
ITEMP/I8 = 00000108; or ITEMP/I8=108; same result
FTEMP/F8=ITEMP;
BTEMP/A8=FTOA(FTEMP,'(F8)',BTEMP);
CTEMP/A15=BTEMP || ' ' | 'days';

and CTEMP is then '108 days'
This works; Icky, but works;
FTOA is 'floating point to alpha' and is on page 9-6 in the manual "Using Functions"
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<bigpgo>
posted
FTOA worked! Thanks for all your help.

(I do not have a copy of the manual, and I have not been able to find complete documentation online; that's why I did not know about FTOA or how it worked)
Thanks again.
 
Report This Post
<monte2000>
posted
bigpo - Have you visited Tech Support or Documentation Services?
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     leading zeros: integers to string

Copyright © 1996-2020 Information Builders