Link Details

Link 902079 thumbnail
User 330795 avatar

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!
  • 3
  • 1
  • 581
  • 429

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (3)



Downvoters (1)



Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java