Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ToOrdinalWords to use existing NumberToWordsExtension #186

Merged
merged 3 commits into from
Apr 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###In Development

- [#186](https://github.com/Mehdik/Humanizer/pull/186): Refactored 'ToOrdinalWords` to use existing `NumberToWordsExtension` to prepare for Ordinal localization.
[Commits](https://github.com/MehdiK/Humanizer/compare/v1.20.2...master)

###v1.20.2 - 2014-04-11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ public class NoMatchFoundException
public NoMatchFoundException(string message, System.Exception inner) { }
}

public class NumberToOrdinalWordsExtension
{
public string ToOrdinalWords(int number) { }
}

public class NumberToTimeSpanExtensions
{
public System.TimeSpan Days(int days) { }
Expand All @@ -241,6 +236,7 @@ public class NumberToTimeSpanExtensions

public class NumberToWordsExtension
{
public string ToOrdinalWords(int number) { }
public string ToWords(int number) { }
}

Expand Down
1 change: 0 additions & 1 deletion src/Humanizer/Humanizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
<Compile Include="ToQuantityExtensions.cs" />
<Compile Include="Transformer\To.cs" />
<Compile Include="Transformer\IStringTransformer.cs" />
<Compile Include="NumberToOrdinalWordsExtension.cs" />
<Compile Include="EnumDehumanizeExtensions.cs" />
<Compile Include="EnumHumanizeExtensions.cs" />
<Compile Include="FluentDate\PrepositionsExtensions.cs" />
Expand Down
20 changes: 0 additions & 20 deletions src/Humanizer/NumberToOrdinalWordsExtension.cs

This file was deleted.

10 changes: 10 additions & 0 deletions src/Humanizer/NumberToWordsExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ public static string ToWords(this int number)
return Converter.Convert(number);
}

/// <summary>
/// 1.ToOrdinalWords() -> "first"
/// </summary>
/// <param name="number">Number to be turned to ordinal words</param>
/// <returns></returns>
public static string ToOrdinalWords(this int number)
{
return Converter.ConvertToOrdinal(number);
}

private static INumberToWordsConverter Converter
{
get
Expand Down