Skip to content

Commit afc6ffc

Browse files
committed
Uses Integer values when creating BigDecimal values to avoid the decimal point when calling toString
1 parent c6cd0a9 commit afc6ffc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/stdlib/Implicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ object Implicits extends FlatSpec with Matchers with org.scalaexercises.definiti
105105
def asDefaultImplicits(res0: BigDecimal) {
106106
def howMuchCanIMake_?(hours: Int)(implicit dollarsPerHour: BigDecimal) = dollarsPerHour * hours
107107

108-
implicit val hourlyRate = BigDecimal(34.00)
108+
implicit val hourlyRate = BigDecimal(34)
109109

110110
howMuchCanIMake_?(30) should be(res0)
111111
}
@@ -116,7 +116,7 @@ object Implicits extends FlatSpec with Matchers with org.scalaexercises.definiti
116116
def howMuchCanIMake_?(hours: Int)(implicit amount: BigDecimal, currencyName: String) =
117117
(amount * hours).toString() + " " + currencyName
118118

119-
implicit val hourlyRate = BigDecimal(34.00)
119+
implicit val hourlyRate = BigDecimal(34)
120120
implicit val currencyName = "Dollars"
121121

122122
howMuchCanIMake_?(30) should be(res0)

0 commit comments

Comments
 (0)