-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Lost units in JSON #10
Comments
Hello, I am not sure that the library was thought to have the quantity serializable.
If you console.log the
I don't know if the library will be update with a serialization feature. The serialize function transform your quantity to:
And the deserialize calls the function that corresponds to the symbol with the amount.
|
Hi @Lukinoh thanks for your reply, indeed I ended up with the same conclusion. I'm using trpc and superjson and some data cross the wire so I need to serialize it. Again for the library. I'm implementing my own serialization. |
Hi all, Thanks for this amazing libraries.
I'm trying to serialize a length in JSON to store it in a JSON Document but I can seem to find the unit in the serialized object. Am I correct. Ths object seem to be serialized as
{"amount":12.5,"dimension":{"length":1}}
it serialize the same way no matter if its a km or a meter. Any advice on how to proceed? I do not want to loose the unit in the process.
Thanks.
The text was updated successfully, but these errors were encountered: