Floats with no decimals are handled differently in transit-clj and transit-cljs

81 views
Skip to first unread message

Francesco Bellomi

unread,
Aug 15, 2016, 7:25:31 PM8/15/16
to transit-format
Hi,

I'm using Transit to exchange data between Clojure and ClojureScript.

The following expression evaluates differently in the two implementations:

(t/write w (float 1.0))

[\"~#'\",1]  ; cljs

[\"~#'\",1.0]  ; clj

This causes a number of mismatching between the two sides, since the cljs output is read as an integer in Clojure.
Should I file an issue? Is there a way to produce floats with no decimals in transit-cljs?

thanks in advance,
Francesco 

Delon Newman

unread,
Nov 3, 2016, 11:20:23 PM11/3/16
to transit-format
Have you found a good work around for this? I'm having the same issue between JS and CLJ.  I think we're both having trouble due to JS's singlular "Number" type.

Thanks,
Delon

Francesco Bellomi

unread,
Nov 14, 2016, 3:46:10 AM11/14/16
to transit-format
No, I haven't found any general work-around, I'm currently fixing the de-serialized data on the server, but it's far from optimal.

Francesco
Reply all
Reply to author
Forward
0 new messages