search

Home  >  Q&A  >  body text

PHP 7.1+ floating point overflow problem after converting to json format

$a = 9.94;
return 	json_encode($a);

The output result is actually

9.9399999999999995

How to solve this problem? The test is normal in 7.0 but there is a problem in 7.1

YBlinYBlin2372 days ago881

reply all(0)I'll reply

No reply
  • Cancelreply