Skip to content

Commit 2b6260e

Browse files
committed
BigDecimal handling
1 parent 94f1755 commit 2b6260e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" % "test"
2929

3030
libraryDependencies += "com.typesafe" % "config" % "1.3.3" % "test"
3131

32-
libraryDependencies += "joda-time" % "joda-time" % "2.9.9" % "test"
32+
libraryDependencies += "joda-time" % "joda-time" % "2.10" % "test"
3333

34-
libraryDependencies += "org.json4s" %% "json4s-native" % "3.5.3" % "test"
34+
libraryDependencies += "org.json4s" %% "json4s-native" % "3.5.4" % "test"
3535

3636
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "2.3.0"
3737

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.1.4
1+
sbt.version=1.1.6

src/main/scala/com/sfxcode/nosql/mongo/bson/BsonConverter.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.sfxcode.nosql.mongo.bson
22

33
import java.math.BigInteger
4-
import java.time.{ LocalDate, LocalDateTime, ZoneId }
4+
import java.time.{LocalDate, LocalDateTime, ZoneId}
55
import java.util.Date
66

7-
import org.bson.{ BsonDecimal128, BsonValue }
87
import org.mongodb.scala.Document
98
import org.mongodb.scala.bson._
109

@@ -41,8 +40,8 @@ object BsonConverter {
4140
case bi: BigInteger => BsonInt64(bi.longValue())
4241
case d: Double => BsonDouble(d)
4342
case f: Float => BsonDouble(f)
44-
case bd: BigDecimal => BsonDecimal128(bd)
45-
case bd: java.math.BigDecimal => BsonDecimal128(bd)
43+
case bd: BigDecimal => BsonDecimal128.apply(bd)
44+
case bd: java.math.BigDecimal => BsonDecimal128.apply(bd)
4645
case doc: Document => BsonDocument(doc)
4746
case map: Map[_, _] =>
4847
var doc = Document()

0 commit comments

Comments
 (0)