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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numeric field converted to a String with comma's 1

Status
Not open for further replies.

kate

Programmer
Nov 19, 2001
51
US
Hi,
I have a numeric field that has a length of nine. I need to convert this field to a string that will have comma's inserted into the proper spaces where comma's go in numbers.

Ex1:
numeric_field1 = 999888777
string1 = "999,888,777"

The numeric field is not always 9 digits long, but the string must always be length of 11.

Ex2:
numeric_field2 = 11222
string2 = " 11,222"

Is there a command that will insert those comma's into the proper places, but will not enter the comma's if they are not needed?

Thanks.
 
Thanks Mike.

1222 is the number.

That command inserted the commas, except that it gave me

"000,001,222"

I need it to give me

" 1,222"

I need the preceding zero's and comma's to not appear in the string. I need them to be replaced with space.
 
I found that

transform(num_value1,"###,###,###")

did the trick for me.

Thanks Mike for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top