Update Order Metafield \n error. For value: "330\n"

I have used the hyphens in each to get rid of the majority of them. For some reason there is one at the end that still does not go away. Exception: Got error updating metafield: “Value must be an integer.” For value: “330\n”, Type: number_integer.

{%- assign total_volume = 0 -%}
{%- for lineItems_item in order.lineItems -%}
{%- assign product_volume = lineItems_item.variant.variantVolume.value -%}
{%- assign item_volume = product_volume | times: lineItems_item.currentQuantity -%}
{%- assign total_volume = total_volume | plus: item_volume -%}
{%- endfor -%}
{{total_volume}}

{{- total_volume -}}

1 Like