I have an amount column and I want to set integer format when the number does not have a decimal and double format when the number has a decimal. in both ways, I want to add separators to numbers. currently, I use bindValue but excel cells don't know the amount column as number format and I should select them and convert them to numbers.
public function bindValue(Cell $cell, $value)
{
if (is_int($value)) {
$cell->setValueExplicit($value, '#,##0');
return true;
}else if (is_double($value)) {
$cell->setValueExplicit($value, '#,##0.00');
return true;
}else{
$cell->setValueExplicit($value, DataType::TYPE_STRING);
return true;
}
}
how can I fix it?