Twig: How to access multiple values from node reference field with number_format I'm adding fields to array:

{% for item in content.field_notes | field_target_entity %}
   {% set field_component_pages = item.field_component_pages|view|number_format %} 
{% endfor %}


In my scenario the value of item.field_component_pages|view is equal "16", but when I convert it to number with number_format I get value of 1.

I presume the item.field_component_pages|view is not a real value. How can I access field field_component_pages correctly in this case?
You can get it form the value. something like item.field_component_pages.0.value properly works for you

{% for item in content.field_notes | field_target_entity %}
   {% set field_component_pages = item.field_component_pages.0.value|number_format %} 
{% endfor %}