implications of changing serialize_precision to -1
-
Hi,
I’m well out of my depth on this question and really need some advice. This is in context of a problem which arose with an EPOS-woocommerce integration which is, hopefully, about to be implemented.
I’ve been asked by the developer to change serialize_precision in php.ini to -1
He explained:
I think your server, for whatever reason, has that value set to something other than the default which, when data is serialised in JSON format to be sent to the API, the precision of the TotalAmount property changes leading to this (from the log):
[2019-08-04 22:01:06] api_create_transaction (failed) Failed to create transaction
Response: “The field TotalAmount must match the regular expression ‘^(-)?(\\d){1,10}(\\.\\d{0,2})?$’.”
Request:
{
“DateTime”:”2019-08-04T22:01:06.000Z”,
”StatusId”:8,
”TotalAmount”:95.4500000000000028421709430404007434844970703125,
”AdjustStock”:false,
”IsTransactionIncTax”:true,
”CustomerId”:2705835
}Notice the TotalAmount has a huge number of decimal places. It’s not possible to round the data, or manipulate it at all once it has been serialised, so the fix I pushed recently to fix this issue, had no effect, because the TotalAmount was already to two decimal places.
Should I just do as asked?
(I didn’t include a system status report since there isn’t an on-site problem… yet)!
The page I need help with: [log in to see the link]
- The topic ‘implications of changing serialize_precision to -1’ is closed to new replies.