The wbformatvalue API module should get a new parameter "property" which can be used instead of "datatype". When "property" is given together with the value, a PropertyValueSnak can be created and the datatype determiend, so wbformatvalue can take full advantage of datatype specific snak rendering. For B/C, wbformatvalue should still function based on the datatype (and even with only the value itself).
This is required to allow the UI to format values exactly as the backend would format them in text context of a given property.