I've found some example code which have this line
string.Format(CultureInfo.InvariantCulture, "{0};{1:f2};{2:f3};",item, someDecimalField, decimalAgain);
What are these {1:f2};{2:f3} and where I can found further info.
Thanks
Those are standard format strings.
"F" is the fixed point format specifier:
The fixed-point ("F) format specifier converts a number to a string of the form "-ddd.ddd…" where each "d" indicates a digit (0-9). The string starts with a minus sign if the number is negative.
The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the current NumberFormatInfoNumberDecimalDigits property supplies the numeric precision.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With