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

Fixed "1 million" number to words in Spanish #235

Merged
merged 2 commits into from
Apr 19, 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
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
###In Development
- [#232](https://github.com/Mehdik/Humanizer/pull/232): Adding code & tests to handle Arabic numbers to ordinal
- [#235](https://github.com/Mehdik/Humanizer/pull/235): Fixed the conversion for "1 millon" in SpanishNumberToWordsConverter

[Commits](https://github.com/MehdiK/Humanizer/compare/v1.23.1...master)

Expand Down
7 changes: 4 additions & 3 deletions src/Humanizer.Tests/Localisation/es/NumberToWordsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ public NumberToWordsTests() : base("es-ES") { }
[InlineData(100, "cien")]
[InlineData(1000, "mil")]
[InlineData(100000, "cien mil")]
[InlineData(1000000, "millón")]
[InlineData(1000000, "un millón")]
[InlineData(10000000, "diez millones")]
[InlineData(100000000, "cien millones")]
[InlineData(1000000000, "mil millones")]
[InlineData(111, "ciento once")]
[InlineData(1111, "mil ciento once")]
[InlineData(111111, "ciento once mil ciento once")]
[InlineData(1111111, "millón ciento once mil ciento once")]
[InlineData(1111111, "un millón ciento once mil ciento once")]
[InlineData(11111111, "once millones ciento once mil ciento once")]
[InlineData(111111111, "ciento once millones ciento once mil ciento once")]
[InlineData(1001111111, "mil millones un millón ciento once mil ciento once")]
[InlineData(1111111111, "mil millones ciento once millones ciento once mil ciento once")]
[InlineData(123, "ciento veintitrés")]
[InlineData(1234, "mil doscientos treinta y cuatro")]
[InlineData(12345, "doce mil trescientos cuarenta y cinco")]
[InlineData(123456, "ciento veintitrés mil cuatrocientos cincuenta y seis")]
[InlineData(1234567, "millón doscientos treinta y cuatro mil quinientos sesenta y siete")]
[InlineData(1234567, "un millón doscientos treinta y cuatro mil quinientos sesenta y siete")]
[InlineData(12345678, "doce millones trescientos cuarenta y cinco mil seiscientos setenta y ocho")]
[InlineData(123456789, "ciento veintitrés millones cuatrocientos cincuenta y seis mil setecientos ochenta y nueve")]
[InlineData(1234567890, "mil millones doscientos treinta y cuatro millones quinientos sesenta y siete mil ochocientos noventa")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override string Convert(int number)
if ((number / 1000000) > 0)
{
parts.Add(number / 1000000 == 1
? string.Format("millón")
? string.Format("un millón")
: string.Format("{0} millones", Convert(number / 1000000)));

number %= 1000000;
Expand Down