turnpike icon indicating copy to clipboard operation
turnpike copied to clipboard

Offer a UseNumber option

Open johnSchnake opened this issue 8 years ago • 1 comments

Since the library uses interface{} types when deserializing messages, integers are all cast to float64. When printing out values in Go, if the value is large enough it prints into scientific notation then.

If there was an option to use UseNumber they would stay as json.Number types which could be parsed as needed downstream.

johnSchnake avatar Oct 03 '16 15:10 johnSchnake

Hi, here you can find my first implementation of this. It's pretty simple, but worked for me. Use turnpike.JSONNUMBER as a serializer.

avdva avatar Apr 06 '17 14:04 avdva