I've got a double, for example
double d = 4.323d;
And I want to display it in a TextBlock on a Silverlight 4 application, but the display should be this:
4.32
And I cannot change the StringFormat on the binding whatsoever.
The exception is that if the number is this:
double d2 = 4d;
Then it should display
4
, not 4.00
.
And the worst exception is that it should take in account the current UI culture, which implies that if the app is deployed in the US it should use a .
as a decimal seperator, and in Europe it should use a ,
(well not in the UK, but you get the point...)
I could set the defaultformat to #.##
IF I were able to change the StringFormat, but I want to do it through CultureInfo