Comment 7 for bug 1302118

Revision history for this message
Dave Cheney (dave-cheney) wrote : Re: [Bug 1302118] Re: config-get returns scientific notation for large ints

The default output format for config-get is json, that number is being
eaten by JSON's terrible handling of integers.

On Fri, Jun 12, 2015 at 6:59 AM, Nate Finch <email address hidden> wrote:
> note, a quick test with goyaml shows it does the right thing. Must be
> somewhere else turning it into a float.
>
> --
> You received this bug notification because you are subscribed to juju-
> core.
> Matching subscriptions: MOAR JUJU SPAM!
> https://bugs.launchpad.net/bugs/1302118
>
> Title:
> config-get returns scientific notation for large ints
>
> Status in goyaml:
> New
> Status in juju-core:
> Triaged
>
> Bug description:
> I was writing a new charm and I found an interesting problem.
>
> When I put a large int value in config.yaml (30000000) and read this
> value in config-changed with config-get it returned the scientific
> notation of that number 3e+07.
>
> This result was unexpected and very hard to deal with the number in a
> bash script. I was trying to do some math with "bc" which does not
> recognize this format of scientific notation.
>
> I have included a skeleton charm that shows this. Deploy the charm
> and watch the unit logs it will echo the value from the config-changed
> hook.
>
> Please let me know if you need any more information.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/goyaml/+bug/1302118/+subscriptions