[Vala] jSON parser



in this examples Im parse a JSON:

{"data":50} // JSON

var parser = new Json.Parser ();
parser.load_from_file ("cuota.json");

var root_object = parser.get_root ().get_object ();
stdout.printf ("data: %d\n", root_object.get_int_member ("data"));
// work perfect!!!!!


{"data":50.65} // jSON
stdout.printf ("data: %d\n", root_object.get_int_member ("data"));
// dont work!

I cant control the value. ¿How get variant type data?


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]