Laravel 5.6 pass string to blade component is object ?

Posted 1 year ago by newbie360

when i use blade component

// main view
// component file: views/cp/test.blade.php
<p>{{ number_format($count) }}</p>

get an error number_format() expects parameter 1 to be float, object given

i dd($count) inside the component file

{{ dd($count) }}
{{-- <p>{{ number_format($count) }}</p> --}}

HtmlString {#324 ▼
  #html: "65656"

so how to pass a pure string "65656" to number_format() ?

Please sign in or create an account to participate in this conversation.