0

Cannot append a variable after replacing every third character with commas

Hi, I'm having a lot of trouble understanding why this doesn't work. The flow is as follows:
On input key up, set variable (amount, numeric & evaluate) to read from callback event to get value 

On input blur, set variable (amount_check, numeric & evaluate): 

"{amount}".toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");

Callback, set variable (amount_final, text & not evaluate):

£{amount_check}

Change text property of some text field.

 

For whatever reason, the £ sign appends correctly if I just use the original amount variable after any input of any key but if I try append it to the variable containing the amount with commas, it only ever shows the first 3 digits.

Any help would be appreciated, thanks

1 comment

Please sign in to leave a comment.