You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 28, 2017. It is now read-only.
We currently have BigDecimal converters in the reboot version of json4s-ast. There is an argument that this should be separate from the json4s-ast, however there are also strong arguments for why it should be included, which are
Verifies correctness of the construction of the BigDecimal inside JNumber. As an example, a common rookie mistake is to do something like JNumber(BigDecimal(3434f)), where as, what you should do is something like JNumber(BigDecimal.decimal(3434f)). That method doesn't even exist in Scala 2.10, hence why the reason behind https://github.com/mdedetrich/json4s-ast/blob/reboot/jvm/src/main/scala/org/json4s/JValue.scala#L20
Mandate a standard format for JNumber, which can help in serialization/portability between different libraries that use json4s-ast. Although not currently implemented, having a converter for something like BigDecimal to Array[Byte] does make some sense in establishing a format
Provide convenience methods for really common use cases, i.e. going from BigDecimal to Int when used for things like ids
Can provide performance improvements due to our aggressive use of @inline (see reboot - use of @inline #2)