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

Format () - and integer to string

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi All

This is probably easy but I want to convert an integer (and sometimes a float) to contain decimal separates when a string:

eg

1234567 to '1,234,567' (no decimal places)
7888999.12 to '7,888,999.12'

I need to use the Format function but can't get the format string right.

Grateful of help,
lou
 
use format('%n',[1234567]);
and format('%.2n',[7888999.12]);

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Done it formatfloat instead

formatfloat('#,0.#', value);
 
Thanks whosrdaddy.

Sorry posted at the same time. Will try your suggestions, though.

many thanks
lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top