Title: Function stopped working
Last modified: March 4, 2022

---

# Function stopped working

 *  Resolved [immentochar](https://wordpress.org/support/users/immentochar/)
 * (@immentochar)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/function-stopped-working/)
 * I had this function working where it returned a number based on a postcode – 
   it no longer works and I don’t understand why.
 *     ```
       (function(){
       switch((new String(fieldname46)).toUpperCase())
       {
       case 'B': return '176.40';
       case 'CV': return '181.80';
       case 'DE': return '127.50';
       case 'DN': return '179.40';
       case 'DY': return '181.80';
       case 'HD': return '201.30';
       case 'HX': return '214.80';
       case 'LE': return '158.40';
       case 'LU': return '285.00'
       case 'LS': return '201.30';
       case 'M': return '222.30';
       case 'MK': return '213.60';
       case 'NG': return '144';
       case 'NN': return '196.50';
       case 'PE': return '210';
       case 'S': return '177.60';
       case 'SK': return '207.30';
       case 'ST': return '165.30';
       case 'WK': return '195.90';
       case 'WR': return '212.40';
       case 'WS': return '172.80';
       case 'WV': return '177.60';
       case 'YO': return '217.20';
   
       default: return fieldname47;
       }
       })();
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/function-stopped-working/#post-15426400)
 * Hello [@immentochar](https://wordpress.org/support/users/immentochar/)
 * The equation’s structure is correct. Please, send me the link to the page that
   contains the form to check the equation in action.
 * Best regards.
 *  Thread Starter [immentochar](https://wordpress.org/support/users/immentochar/)
 * (@immentochar)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/function-stopped-working/#post-15426417)
 * [https://myxenon.co.uk/quote/](https://myxenon.co.uk/quote/)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/function-stopped-working/#post-15428027)
 * Hello [@immentochar](https://wordpress.org/support/users/immentochar/)
 * My apologies for the delay in responding to you. The problem is due to this line
   of code:
 * `case 'LU': return '285.00'`
 * You forgotten the semicolon at the end. The correct would be:
 * `case 'LU': return '285.00';`
 * Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Function stopped working’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/function-stopped-working/#post-15428027)
 * Status: resolved