sim_balance method: used in bundles array is string instead of number?

16 views
Skip to first unread message

My Viking app

unread,
Apr 1, 2014, 3:50:19 PM4/1/14
to mobile-vikin...@googlegroups.com
Hi,

I noticed the used element in the bundles array returned by the sim_balance method is a string and not a number. The value & assigned elements are returned as numbers though. Is this intentional or a glitch?


Example snippet:

"bundles": [
        {
            "valid_until": "2014-04-02 00:00:00",
            "valid_from": "2014-04-01 00:00:00",
            "value": 300,
            "assigned": 300,
            "used": "0.000000",
            "type": "sms_super_on_net"
        },
        {
            "valid_until": "2014-04-02 00:00:00",
            "valid_from": "2014-04-01 00:00:00",
            "value": 3600,
            "assigned": 3600,
            "used": "0.000000",
            "type": "voice_super_on_net"
        },
        {
            "valid_until": "2014-04-16 17:34:19",
            "valid_from": "2014-03-16 17:34:19",
            "value": 498,
            "assigned": 500,
            "used": "2.000000",
            "type": "sms"
        },
        {
            "valid_until": "2014-04-16 17:34:19",
            "valid_from": "2014-03-16 17:34:19",
            "value": 279818009,
            "assigned": 524288000,
            "used": "244469991.000000",
            "type": "data"
        }
    ], 

Yannick

Niels Van Och

unread,
Apr 2, 2014, 4:25:34 AM4/2/14
to mobile-vikin...@googlegroups.com
Hi,

I agree that it's a little strange, but I'm hesitant to change it since it's always been like this, so we might break another app. The 'logic' here is that the used-field is a floating-point number, while the others are integers. So somewhere between intentional and glitch ;)

Is this something that's actively bothering you, or more of an informative question?

Niels

My Viking app

unread,
Apr 4, 2014, 3:17:52 PM4/4/14
to mobile-vikin...@googlegroups.com
I'm working on a feature for which I need the used value. It's not critical, I can parse it, I understand you can't just change it. Maybe it's something that can be addressed in a next version of the API?
Reply all
Reply to author
Forward
0 new messages