You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System/IFormattable.xml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,11 +81,13 @@
81
81
The following example defines a `Temperature` class that implements the <xref:System.IFormattable> interface. The class supports four format specifiers: "G" and "C", which indicate that the temperature is to be displayed in Celsius; "F", which indicates that the temperature is to be displayed in Fahrenheit; and "K", which indicates that the temperature is to be displayed in Kelvin. In addition, the <xref:System.IFormattable.ToString%2A?displayProperty=nameWithType> implementation also can handle a format string that is `null` or empty. The other two `ToString` methods defined by the `Temperature` class simply wrap a call to the <xref:System.IFormattable.ToString%2A?displayProperty=nameWithType> implementation.
The following example then calls the <xref:System.IFormattable.ToString%2A?displayProperty=nameWithType> implementation either directly or by using a composite format string.
The following example demonstrates a `Temperature` class that implements the <xref:System.IFormattable.ToString%2A> method. This code example is part of a larger example provided for the <xref:System.IFormattable> class.
0 commit comments