<%
  error_messages = local_assigns[:error_messages] || []
  hint = local_assigns[:hint]
  labelled_by = "#{field}-a"
%>

<div class="form-group <%= 'error' unless error_messages.empty? %>">
  <label class="form-label" for="<%= field %>">
    <%= label %>
    <%= content_tag :span, hint, class: 'form-hint' unless hint.blank? %>
  </label>
  <%= simple_format error_messages.join("\n"), { class: 'error-message' }, wrapper_tag: 'span' %>
  <%= content_tag :span, '£', id: labelled_by %>
  <%= text_field_tag field, number_to_currency(value, unit: ''), 'aria-labelledby' => labelled_by,
                     class: %w(form-control calculator__field) << "t-calculator-#{field}" %>
</div>

<%
  error_messages = local_assigns[:error_messages] || []
  hint = local_assigns[:hint]
  labelled_by_symbol = "#{field}-symbol"
  labelled_by_label = "#{field}-label"
%>

<div class="form-group <%= 'error' unless error_messages.empty? %>">
  <label class="form-label" for="<%= field %>" id="<%= labelled_by_label %>">
    <%= label %>
    <%= content_tag :span, hint, class: 'form-hint' unless hint.blank? %>
  </label>
  <%= simple_format error_messages.join("\n"), { class: 'error-message' }, wrapper_tag: 'span' %>
  <%= content_tag :span, '£', id: labelled_by_symbol %>
  <%= text_field_tag field, number_to_currency(value, unit: ''), 'aria-labelledby' => "#{labelled_by_label} #{labelled_by_symbol}",
                     class: %w(form-control calculator__field) << "t-calculator-#{field}" %>
</div>

Improve screen reader labelling for currency fields
Improve screen reader labelling for currency fields

Ensure screen readers will read out both the label and currency symbol for these fields.
