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. morcos cross-referenced this on Jun 17, 2015 from issue JSON parsing broken for RPC tests by morcos
  5. jonasschnelli commented at 3:38 PM on June 17, 2015: contributor

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

  6. 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).

  7. 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.

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

    Working on this now.

  9. laanwj referenced this in commit e3134d9f7e on Jul 6, 2015
  10. laanwj referenced this in commit 9d8fc7e7f7 on Jul 6, 2015
  11. laanwj cross-referenced this on Jul 6, 2015 from issue rpc: Accept scientific notation for monetary amounts in JSON by laanwj
  12. laanwj referenced this in commit 9cc91523db on Jul 10, 2015
  13. laanwj commented at 4:06 PM on February 9, 2016: member

    Fixed by #6379

  14. laanwj closed this on Feb 9, 2016

  15. FornaxA referenced this in commit d6361f6ec5 on Jul 6, 2020
  16. cryptolinux referenced this in commit 184471ba96 on Feb 6, 2021
  17. ckti referenced this in commit b4a0c8824e on Mar 29, 2021
  18. bitcoin 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-05-20 06:55 UTC