diff --git a/release_notes.md b/release_notes.md index 128cd6fbf..16f6f7726 100644 --- a/release_notes.md +++ b/release_notes.md @@ -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) diff --git a/src/Humanizer.Tests/Localisation/es/NumberToWordsTests.cs b/src/Humanizer.Tests/Localisation/es/NumberToWordsTests.cs index 76d42918c..5dcaf3a7d 100644 --- a/src/Humanizer.Tests/Localisation/es/NumberToWordsTests.cs +++ b/src/Humanizer.Tests/Localisation/es/NumberToWordsTests.cs @@ -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")] diff --git a/src/Humanizer/Localisation/NumberToWords/SpanishNumberToWordsConverter.cs b/src/Humanizer/Localisation/NumberToWords/SpanishNumberToWordsConverter.cs index c3b964c34..a3afe02ab 100644 --- a/src/Humanizer/Localisation/NumberToWords/SpanishNumberToWordsConverter.cs +++ b/src/Humanizer/Localisation/NumberToWords/SpanishNumberToWordsConverter.cs @@ -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;