|
-
Dec 14th, 2006, 02:40 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Concatenating 2 integers Crystal
hello, I need to join 2 integers together as if they were strings.
ie. 10000 + 01 = 1000001
also how would I format it so a 1 would dispay 01? thanks!
-
Dec 14th, 2006, 02:55 PM
#2
Thread Starter
Frenzied Member
Re: Concatenating 2 integers Crystal
I did it with the following but I am sure there is probably a better way
replace(replace(totext({PL_Shipping_Template.PL_Header_Invoice_Number}),".00","") & "-" & totext({PL_Shipping_Template.PL_Header_BO_Number},"00"),",","")
for some reason my invoice_number was adding .00 to the end that is why there are 2 replace calls.
-
Dec 14th, 2006, 04:07 PM
#3
Re: Concatenating 2 integers Crystal
All numbers in Crystal are decimal values. When converting numbers to text, the second argument can also be used to indicate the number of decimal places to include (if you include a format in the second argument - decimal places argument becomes the third argument).
The third (or fourth) argument lets you overide the thousand separator.
This formula returns a number. You can then Format that number using the normal means.
Code:
ToNumber (ToText (PL_Shipping_Template.PL_Header_Invoice_Number, 0,'' ) +
ToText (PL_Shipping_Template.PL_Header_Invoice_Number, "00",0,'')
)
It wasn't clear if you wanted the Formula to return a number or a string. If string add another ToText around the above formula.
Last edited by brucevde; Dec 14th, 2006 at 04:17 PM.
-
Dec 14th, 2006, 04:16 PM
#4
Thread Starter
Frenzied Member
Re: Concatenating 2 integers Crystal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|