65 | | WARNING: Using Decimal causes rounding errors. This is because pyson takes python's json representation format which contains floats for numbers. And floats can not represent all decimals accurately. For example, in python {{{str(0.24745759773026107) == '0.24745759773026108'}}}. Overall, a number string "N" in your json text will converted as {{{Decimal(str(float("N")))}}} . When in doubt, check for your number "N" that str(float(N))==N, if not you have a rounding issue. |
66 | | |
| 65 | {{{#!td style="background: #fee" |
| 66 | Using Decimal may cause rounding errors even before they get to Pyson, because json converts them to float. And floats can not represent all decimals accurately. For example, in python {{{str(0.24745759773026107) == '0.24745759773026108'}}}. Overall, a number string "N" in your json text will converted as {{{Decimal(str(float("N")))}}} . When in doubt, check for your number "N" that str(float(N))==N, if not you have a rounding issue. |
| 67 | }}} |