JsonNumber to long or int

40 views
Skip to first unread message

Navin Mishra

unread,
Jun 18, 2014, 10:41:23 AM6/18/14
to jay...@googlegroups.com
Hi,

  Is it possible to determine if a JsonNumber contains a long or int number so that it can be converted to long or int number? If converting always to int, problem happens if the number is actually a long and, if so, a negative number is returned.

Thanks and regards

Atif Aziz

unread,
Jun 20, 2014, 1:08:12 PM6/20/14
to jay...@googlegroups.com
You can try and convert the JsonNumber to long always and if it's within the bounds of int.MinValue and int.MaxValue then return it as int otherwise leave it as long.

- Atif


--
You received this message because you are subscribed to the Google Groups "Jayrock" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jayrock+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages