From the code it seems like some simple formatting, if I’m correct the number +11234567890 becomes 123-456-7890.
It is not directly possible with the UI in Wappler, but you can use the replace formatter with a regexp. '+11234567890'.replace(/^\+\d(\d{3})(\d{3})(\d{4})$/, '$1-$2-$3'). The UI won’t let you enter a regexp, it will enter it as string and you need to edit it directly in codeview.
I have a similar problem and am not sure where to do the “replace”. All of my phone numbers are listed in the database like: 1234567890. I would like for the output to be: 123-456-7890
What is the best way to accomplish this in Wappler?
I’m displaying this data in a table, here is part of the code:
Is the value a number or a string? The replace formatter only works on strings, try people_phone.toString().replace(/(\d{3})(\d{3})(\d{4})$/, '$1-$2-$3')