0

When I parse json, is there any way to distinct this situations:

my_value = "123"

and

my_value = 123

?

ephemerr
  • 1,833
  • 19
  • 22

1 Answers1

1

Yes, you can get the type of JSON values. In order to get it, you need to call QJsonValue::type() function. In your case it will return either QJsonValue::String or QJsonValue::Double respectively.

vahancho
  • 20,808
  • 3
  • 47
  • 55