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

ERROR: A non-numeric value encountered - language issue #600

Closed
SebastianSchoeps opened this issue May 27, 2019 · 7 comments
Closed

ERROR: A non-numeric value encountered - language issue #600

SebastianSchoeps opened this issue May 27, 2019 · 7 comments

Comments

@SebastianSchoeps
Copy link

Different issue than #597

  • Horizon Version: 3.2.1
  • Laravel Version: 5.8.18
  • PHP Version: 7.3.3

Description:

Running on Valet on MacOS Mojave 10.14.4 - on a German system, and that's the issue.

exec ps axo %cpu,%mem,command returns something like
%CPU %MEM COMMAND
0,0 0,1 /sbin/launchd
0,0 0,0 /usr/sbin/syslogd
0,0 0,1 /usr/libexec/UserEventAgent (System)

The separator in German is a comma. Parsing that fails in SystemProcessCounter.

Steps To Reproduce:

"3,4" / 100 ==> "PHP Notice: A non well formed numeric value encountered"

Solution

Use "float":
return ['cpu' => (float) $row->first() / 100, 'mem' => (float) $row->last()];

@brunogaspar
Copy link

Duplicate of #597

@SebastianSchoeps
Copy link
Author

As I stated, from my point of view it's another issue. #597 drifted towards Alpine - this is about a decimals separator other than ".".

@driesvints
Copy link
Member

Ping @AJenbo: can we use the solution from above?

@AJenbo
Copy link
Contributor

AJenbo commented May 28, 2019

Afaik it will loose precision, but I can probably either set the local for the command or do propper parsing of the local specific format to get the correct value. I plan to work on it today so this is good timing 🙂

@driesvints
Copy link
Member

Thanks!

@tomswinkels
Copy link
Contributor

Same issue? #606

@driesvints
Copy link
Member

@tomswinkels I believe so.

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

No branches or pull requests

5 participants