Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert value every other character 1

Status
Not open for further replies.

Naith

Programmer
May 14, 2002
2,530
0
0
GB
Can one of you bright sparks display the logical way to convert these values:

2000
9999999
13

to

2 0 0 0
9 9 9 9 9 9 9
1 3

All source values are numerical, but naturally, it isn't essential that the formula preserve this.
 
This should give you what you want, convert the number to a string and then step through each character and add the space.

Code:
local NumberVar i;
local StringVar strValue := cstr({MyField},0,'');
local stringvar strTemp;

For i := 1 to Len(strValue)
Do(
strTemp := strTemp & strValue[i] & ' ');

Left(strTemp,Len(strTemp) -1)

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top