Apr 19, 2006 #1 sabetik IS-IT--Management Nov 16, 2003 80 GU How can I convert 123455 to $1,234.55 by using printf. Thanks
Apr 19, 2006 #2 Krunek Programmer Feb 14, 2001 140 HR 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. Upvote 0 Downvote
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.
Apr 20, 2006 Thread starter #3 sabetik IS-IT--Management Nov 16, 2003 80 GU I know how to convert to floating point not sure to print "$" Upvote 0 Downvote
Apr 20, 2006 #4 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE 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 Upvote 0 Downvote
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
Apr 20, 2006 #5 olded Programmer Oct 27, 1998 1,065 US I don't think that printf will include commas for you. Eric Pement provides a sed solution at: http://www.student.northpark.edu/pemente/sed/sed1line.txt Upvote 0 Downvote
I don't think that printf will include commas for you. Eric Pement provides a sed solution at: http://www.student.northpark.edu/pemente/sed/sed1line.txt