We already have a module for parsing data values (the parsevalue module supplied by the DataValues extension). There should be an analogous module for formatting values.
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51111