This topic is something that does not have
a right answer, but I’ll express my point of view hoping it can be of help.
As you said, having the formatting done in the service that retrieves the value is an unnecessary overhead for the service’s interface, as it should only care on returning the value. Formatting the number
is specifically related to the presentation layer of your application, so it should be done there instead of the business logic of your application which is where the service works.
In my personal opinion, taking advantage of WPF
ValueConverters would be the way to go here. This way, the service only gets the required information and the properties always hold the same value. You simply change the
ValueConverter associated to the binding to get the different formats.
Another approach could be a “formatting service” that lives in the presentation layer, and is in charge of formatting the numbers before they are exposed by properties in the ViewModel for the View
to bind to.
One possible case when providing multiple service methods to get more/less precision from the service is a viable approach is if getting a value with more resolution takes considerably more time than without it.
That way, if you don’t actually need the extra numbers you can save the extra time.
Please let me know if this helps.