0
 $sheet->setCellValue("H221", $task->amount); //42.1234567894123

But writes "42.123456789412"

Excell cell image

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • 2
    I don't think it has anything to do with PHPOffice. When you just try to use the value anywhere else you'll get the same result. This is most likely caused by the [`precision` configuration directive](https://www.php.net/manual/en/ini.core.php#ini.precision). (Although with such number precision, you could also walk into the limits of what a number in PHP can hold.) You could consider using a string instead of a number. – Ivar Feb 02 '21 at 14:36
  • Thanks for answer, i’ve used strings as well both causing same results. But I’ve tried returning same amounts with response and got right amounts. I think this excel limitations. – Nicat Quliyev Feb 02 '21 at 15:23
  • I think @Ivar is true based on php documentation of [floating point numbers](https://www.php.net/manual/en/language.types.float.php) – Zeikman Feb 07 '23 at 08:21

0 Answers0