openframeworks/openFrameworks — pull request #1238 by damiannz (2012-05-03 14:31:05+00:00)
Title: Feature: ofToString float formatting arguments

Adds two new forms of ofToString:

~~~~
string ofToString(const T& value, int width, char fill );
~~~~

Behaves like `"%04d"` or `"%04f"` arguments to `printf`, with `width=4` and `fill='0'` in this example. Use to prettily align numbers, using `fill=' '`.

~~~~
string ofToString(const T& value, int precision, int width, char fill=' ' );
~~~~

Behaves like `"%04.2f"` with `width=4`, `precision=2` and `fill='0'` in this example.