I'm using scientific notation in XAML. I do:
<TextBox Text="{Binding Path=CELULARIDAD_CFU, StringFormat='e6'}"/>
The problem is that for 1710000 is showing: 1.710000e+006, which is correct but I would like to see 1.71e+6. How is this specified in XAML? (Not in code)
I didn't found exactly what I want so I decided to use an IValueConverter. Example:
And then in the XAML page:
I hope it helps.
I believe you should use the G format specifier to get (almost) what you want.
Within a certain range (different for different number types, see link) the number will then be displayed in normal notation. For large or small enough values, the values will be displayed without trailing zeroes and 2 exponent digits.
Examples for
float
: