From b9ab6e02e6795dc1fe561144efef365cb343d5be Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Tue, 2 Jun 2020 08:34:14 -0400 Subject: [PATCH] Add missing doc tag values to fix warnings --- src/Humanizer/HeadingExtensions.cs | 1 + src/Humanizer/InflectorExtensions.cs | 2 -- src/Humanizer/TimeSpanHumanizeExtensions.cs | 2 ++ src/Humanizer/ToQuantityExtensions.cs | 11 ++++++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Humanizer/HeadingExtensions.cs b/src/Humanizer/HeadingExtensions.cs index 2bb524874..a897427e7 100644 --- a/src/Humanizer/HeadingExtensions.cs +++ b/src/Humanizer/HeadingExtensions.cs @@ -36,6 +36,7 @@ public static class HeadingExtensions /// This representation has a maximum deviation of 11.25 degrees. /// /// A textual representation of the heading + /// The heading value /// The culture to return the textual representation in /// Whether to return a short result or not. public static string ToHeading(this double heading, HeadingStyle style = HeadingStyle.Abbreviated, CultureInfo culture = null) diff --git a/src/Humanizer/InflectorExtensions.cs b/src/Humanizer/InflectorExtensions.cs index 4e0e554ca..42bb8cb5d 100644 --- a/src/Humanizer/InflectorExtensions.cs +++ b/src/Humanizer/InflectorExtensions.cs @@ -68,7 +68,6 @@ public static string Titleize(this string input) /// By default, pascalize converts strings to UpperCamelCase also removing underscores /// /// - /// "This has a space" -> "ThisHasASpace" if true /// public static string Pascalize(this string input) { @@ -79,7 +78,6 @@ public static string Pascalize(this string input) /// Same as Pascalize except that the first character is lower case /// /// - /// "This has a space" -> "thisHasASpace" if true /// public static string Camelize(this string input) { diff --git a/src/Humanizer/TimeSpanHumanizeExtensions.cs b/src/Humanizer/TimeSpanHumanizeExtensions.cs index f02e2b4f5..7ab751898 100644 --- a/src/Humanizer/TimeSpanHumanizeExtensions.cs +++ b/src/Humanizer/TimeSpanHumanizeExtensions.cs @@ -26,6 +26,7 @@ public static class TimeSpanHumanizeExtensions /// The maximum unit of time to output. The default value is . The time units and will give approximations for time spans bigger 30 days by calculating with 365.2425 days a year and 30.4369 days a month. /// The minimum unit of time to output. /// The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + /// Uses words instead of numbers if true. E.g. one day. /// public static string Humanize(this TimeSpan timeSpan, int precision = 1, CultureInfo culture = null, TimeUnit maxUnit = TimeUnit.Week, TimeUnit minUnit = TimeUnit.Millisecond, string collectionSeparator = ", ", bool toWords = false) { @@ -42,6 +43,7 @@ public static string Humanize(this TimeSpan timeSpan, int precision = 1, Culture /// The maximum unit of time to output. The default value is . The time units and will give approximations for time spans bigger than 30 days by calculating with 365.2425 days a year and 30.4369 days a month. /// The minimum unit of time to output. /// The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + /// Uses words instead of numbers if true. E.g. one day. /// public static string Humanize(this TimeSpan timeSpan, int precision, bool countEmptyUnits, CultureInfo culture = null, TimeUnit maxUnit = TimeUnit.Week, TimeUnit minUnit = TimeUnit.Millisecond, string collectionSeparator = ", ", bool toWords = false) { diff --git a/src/Humanizer/ToQuantityExtensions.cs b/src/Humanizer/ToQuantityExtensions.cs index ac40dbfba..58c90d0a2 100644 --- a/src/Humanizer/ToQuantityExtensions.cs +++ b/src/Humanizer/ToQuantityExtensions.cs @@ -145,7 +145,16 @@ public static string ToQuantity(this string input, double quantity, string forma return string.Format(formatProvider, "{0} {1}", quantity.ToString(format, formatProvider), transformedInput); } - + + /// + /// Prefixes the provided word with the number and accordingly pluralizes or singularizes the word + /// + /// The word to be prefixed + /// The quantity of the word + /// + /// "request".ToQuantity(0.2) => "0.2 requests" + /// + /// public static string ToQuantity(this string input, double quantity) { return ToQuantity(input, quantity, null, null);