Commit 128101d6 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Correction pb suite modif gestion des floats

parent 6f04d50f
Loading
Loading
Loading
Loading
Loading
+5 −4
Changes for src/Table.php: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -481,14 +481,15 @@ class Table
                        if (in_array($c, $options['update-only-null']) && $oldc !== null) $ok = false;

                        if ($ok) {
                            if ((is_float($newc) || is_double($newc))
                                && (is_float($oldc) || is_double($oldc))
                                && abs($newc - $oldc) > 0.0000000001
                            ) {
                            if ((is_float($newc) || is_double($newc)) && (is_float($oldc) || is_double($oldc))) {
                                if (abs($newc - $oldc) > 0.0000000001) {
                                    // nécessaire à cause des pb de précision des float/doubles en PHP :
                                    // dans ce cas, on considère quand même que les 2 chiffres sont identiques
                                    $toUpdate[$c] = $n[$c];
                                }
                            }else{
                               $toUpdate[$c] = $n[$c];
                            }
                        }
                    }
                }