Skip to content

Commit

Permalink
Merge pull request #235 from kblok/es-million
Browse files Browse the repository at this point in the history
Fixed "1 million" number to words in Spanish
  • Loading branch information
MehdiK committed Apr 19, 2014
2 parents b50102e + aa00d24 commit 9d32126
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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

0 comments on commit 9d32126

Please sign in to comment.