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
- Formats dates and durations using DateTime and TimeSpan values instead of numeric values like Excel.
31
31
- Targets net20 and netstandard1.0 for max compatibility.
32
32
33
+
## Formatting .NET types
34
+
35
+
The `Format()` method takes a value of type `object` as parameter. Internally, the value is cast or converted to a specific .NET type depending on the kind of number format:
36
+
37
+
Format Kind | Example | .NET type|Conversion strategy
38
+
-|-|-|-
39
+
Number | 0.00 |double|Convert.ToDouble()
40
+
Fraction | 0/0 |double|Convert.ToDouble()
41
+
Exponent | \#0.0E+0 |double|Convert.ToDouble()
42
+
Date/Time| hh\:mm |DateTime|Convert.ToDateTime()
43
+
Duration | \[hh\]\:mm|TimeSpan|Cast to TimeSpan
44
+
General | General |(any)|Convert.ToString()
45
+
Text | ;;;"Text: "@|string|Convert.ToString()
46
+
47
+
In case of errors, `Format()` returns the value from `Convert.ToString()`.
48
+
33
49
## TODO/notes
34
50
35
51
- 'General' is formatted with `.ToString()` instead of Excel conventions.
0 commit comments