-
Notifications
You must be signed in to change notification settings - Fork 3
reboot - using BigDecimal converters #3
Comments
It's a fuzzy line, but this seems non-minimal to me. |
I think this is why having
Locale/CharSet? I haven't delved into this area, so I think you know more than me in this area.
Indeed it is fuzzy, the only real compelling case I can come up with for inclusion that isn't convenience is inter-opting between the various By interopting, I mean that we have libraries A and B, both of which use Like I said before, these were in there when I started, so maybe we can asking @casualjim if there was a reason why they are there. If its because |
Going to close this for now, I have let the converters in there, if anyone has complaints, re-open the ticket |
We currently have
BigDecimal
converters in the reboot version ofjson4s-ast
. There is an argument that this should be separate from thejson4s-ast
, however there are also strong arguments for why it should be included, which areBigDecimal
insideJNumber
. As an example, a common rookie mistake is to do something likeJNumber(BigDecimal(3434f))
, where as, what you should do is something likeJNumber(BigDecimal.decimal(3434f))
. That method doesn't even exist inScala 2.10
, hence why the reason behind https://github.com/mdedetrich/json4s-ast/blob/reboot/jvm/src/main/scala/org/json4s/JValue.scala#L20JNumber
, which can help in serialization/portability between different libraries that usejson4s-ast
. Although not currently implemented, having a converter for something likeBigDecimal
toArray[Byte]
does make some sense in establishing a formatBigDecimal
toInt
when used for things like ids@inline
(see reboot - use of @inline #2)The text was updated successfully, but these errors were encountered: