Friday, June 11, 2010

just use this one if you need per-thread smart(produces ints if can) parsing of json numbers:

trait SmartJsonNumberParsing {
  val doubleRe = """.*\..*""".r
  scala.util.parsing.json.JSON.perThreadNumberParser = { n : String => n match { case doubleRe() => BigDecimal(n) case int => BigInt(n) }}
}

No comments:

Post a Comment