RPC doesn't accept scientific notation for amounts #6297

issue laanwj opened this issue on June 17, 2015
  1. laanwj commented at 3:26 PM on June 17, 2015: member

    Reported by @morcos on IRC.

    Since the univalue conversion, JSON no longer accepts e.g. 1e-5 as monetary amount. This is required by the JSON standard.

    Parsing diagram numbers

    This breaks e.g. the smartfees.py test. This needs to be fixed in AmountFromValue or ParseMoney.

  2. laanwj added the label RPC on Jun 17, 2015
  3. laanwj added the label Bug on Jun 17, 2015
  4. jonasschnelli commented at 3:38 PM on June 17, 2015: contributor

    Thanks @morcos for reporting. Will have a look at this soon.

  5. laanwj commented at 3:44 PM on June 17, 2015: member

    It's a matter of writing our own fixed-point parser that accepts the full JSON number syntax. Not rocket science, but will need a lot of testing, interpreting monetary amounts wrongly would be an extremely serious bug (that's why I hoped the time-tested ParseMoney would do... maybe adding eE* isn't that involved, I don't know).

  6. MrKrzYch00 commented at 6:55 PM on July 5, 2015: none

    This makes PHP scripts unable to "talk" with Bitcoin RPC correctly when using values <0.0001 through json_encode.

  7. laanwj commented at 7:40 AM on July 6, 2015: member

    Working on this now.

  8. laanwj referenced this in commit e3134d9f7e on Jul 6, 2015
  9. laanwj referenced this in commit 9d8fc7e7f7 on Jul 6, 2015
  10. laanwj referenced this in commit 9cc91523db on Jul 10, 2015
  11. laanwj commented at 4:06 PM on February 9, 2016: member

    Fixed by #6379

  12. laanwj closed this on Feb 9, 2016

  13. FornaxA referenced this in commit d6361f6ec5 on Jul 6, 2020
  14. cryptolinux referenced this in commit 184471ba96 on Feb 6, 2021
  15. ckti referenced this in commit b4a0c8824e on Mar 29, 2021
  16. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me