Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHugo Hayes
Courses Plus Student 13,146 PointsSpanish(Argentina) default currency format doesn't match assertThat(statements, contains(..............
com.teamtreehouse.challenges.homes.MainTest > argentinaRecordsAreFormattedAndConverted FAILED
java.lang.AssertionError:
Expected: iterable containing ["First is $1.00 (USD) which is $15,48 (Argentine Peso)", "Second is $2.00 (USD) which is $30,96 (Argentine Peso)"]
but: item 0: was "First is $1.00 (USD) which is $ 15,48 (Argentine Peso)"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.junit.Assert.assertThat(Assert.java:865)
at org.junit.Assert.assertThat(Assert.java:832)
at com.teamtreehouse.challenges.homes.MainTest.argentinaRecordsAreFormattedAndConverted(MainTest.java:99)
The default Spanish(Argentina) currency format had this wierd space between $ and the number,so I can't pass the prepareSubmission.gradle build. Changing currency format in Windows control panel didn't work. And Yes The Question I post in the actual code challenge section got no response, so I came here.
(P.S I 'm saying wierd space because adding space in the MainTest didn't work)
2 Answers
Leon Geerdink
12,579 PointsTo fix, replace the NBSPs with empty strings in the return statement of the argentineCurrencyFormatter function.
return String.format("%s (%s)",
currencyFormatter.format(price),
currentCurrency.getDisplayName()
).replace("\u00a0","");
Andre Kucharzyk
4,479 PointsIs that a bug in the excercise?
Leon Geerdink
12,579 PointsYes. I think it is a bug.
Nick Frozz
31,289 PointsNick Frozz
31,289 PointsIt's ($--> <--15,48) not a "space" it's something called "U+00A0 : NO-BREAK SPACE [NBSP]"
"First is $1.00 (USD) which is $ 15,48 (Argentine Peso)",
"Second is $2.00 (USD) which is $ 30,96 (Argentine Peso)"