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

Format

Status
Not open for further replies.

sabetik

IS-IT--Management
Nov 16, 2003
80
GU
How can I convert 123455 to $1,234.55 by using printf.

Thanks
 

Hello, sabetik!

As I know, you must convert integer 123455 to floating-point number 1234.55 and then you can use printf function.

God bless you. Bye!

KP.
 
I know how to convert to floating point not sure to print "$"
 
printf "$%6.2f\n", 123.45

works in my awk (AIX)
not sure how/if you can specify a thousand separator in the format string.

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top