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 2 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
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [#151](https://github.com/MehdiK/Humanizer/pull/151): Added Spanish ToWords Translations
- [#172](https://github.com/MehdiK/Humanizer/pull/172): Added Polish translation for ToWords
- [#184](https://github.com/Mehdik/Humanizer/pull/184): Fixed spelling error with forth/fourth in EnglishNumberToWordsConverter
- [#186](https://github.com/Mehdik/Humanizer/pull/186): Refactored 'ToOrdinalWords` to use existing `NumberToWordsExtension` to prepare for Ordinal localization.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added your PR to v1.20.2. Please add it to In Development section.


[Commits](https://github.com/MehdiK/Humanizer/compare/v1.19.1...v1.20.2)

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