Casting to a "number" (both int and float)?

Jussi Piitulainen harvestingn at makes.address.invalid
Fri Aug 28 08:03:02 CEST 2015

Ben Finney writes:

> Victor Hooi writes:
>> Many of the fields are meant to be numerical, however, some fields are
>> wrapped in a "floatApprox" dict, which messed with my parsing.
> The examples you give of ‘floatApprox’ are not dicts, so I'm not sure
> quite what that means.

I took the distinction to be between 123123 and {"floatApprox":
213123123}. The former looks like an int, the latter like a dict.

>>     "network": {
>>         "bytesIn": 123123,
>>         "bytesOut": {
>>             "floatApprox": 213123123
>>         }

> What do you mean by “wrapping”?

I read it so that the bytesOut value, 213123123, is "wrapped" in
{"floatApprox": }, and Victor wants just the number inside.

[- -]

More information about the Python-list mailing list