Proposed function for the Format module: enforceDecimalPlaces(number, places)

I have already integrated my function into revision 295; see the attached patch. This function will deprecate twoDigitFloat (hopefully) because it is more flexible and more true to printf formatting behavior. I also added unit tests, please read the comments for them in the patch.

Please let me know if it needs to be cleaned up or changed in any way, I will get you another patch. If you use this code I would like to keep my copyright but I have no problem with donating this code under this project's license.

-Matthew Elder <sseses@gmail.com>

Attachments