Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2022-09-02 15:00:14] laravel.WARNING: Implicit conversion from float 6.6666666E-62 to int loses precision #13

Open
JoseLuis21 opened this issue Sep 2, 2022 · 1 comment

Comments

@JoseLuis21
Copy link
Contributor

Laravel Logs version 9
WARNING
[2022-09-02 15:00:14] laravel.WARNING: Implicit conversion from float 6.6666666E-62 to int loses precision in /home/www/vendor/freshwork/chilean-bundle/src/Rut.php on line 247

@JoseLuis21
Copy link
Contributor Author

Esta es la solución

public function calculateVerificationNumber() { $rut = $this->number; $s=1; for ($m=0; $rut != 0; $rut /= 10) { $rut_porcentaje = (int)$rut%(int)10; $nine = ((int)9-(int)$m++%(int)6); $s=(((int)$s+$rut_porcentaje*($nine))%(int)11); } return chr($s?$s+47:75); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant