By cwrighta70
via chrismwright.wordpress.com
Published: Jan 08 2013 / 08:21
Recently, I had to write an app that displayed a number of strings each containing a label and a monetary/numerical value (i.e. "Balance: $10,000.00"). One requirement was to make all of the decimal points line up vertically. After searching the net for an easy solution and coming up empty, I decided to write my own function to format the strings properly. This is my solution. And please, if you know an easier solution, let me know! I love learning new methods!
Add your comment