Added numberFormat() to BKit for Completeness

BKit.jpg

I was pretty impressed with Java when it added in the String.format() method. It's very much right out of C and can make some formatting tasks very simple. I added this into the BKJEP expression parser as format() with the pretty impressive Java VarArgs. Pretty nice stuff. But over the course of the last few days I've been wishing for a little more control of the numeric formatting on the format() command. It wasn't allowing the optional decimal place like the DecimalFormat class.

So I decided to put in another method to the BKJEP parser: numberFormat(). This guy takes two arguments: a Number, and a String format consistent with the DecimalFormat class. This helped me clear up a nasty little formatting problem on one of the logging messages I was working on in a project. Very nice to have the flexibility of both, that's for sure.

While I admit the argument list is backwards from the format() function, it's in keeping with the dateFormat() function already in the BKJEP parser. I decided to keep these two similar, and let format() stand alone. It's not perfect, but I didn't want to switch everything and then worry about the things that might break.