0
Hello, I have the following phone and mobile values respectively:
Telephone: 1111111111 Cellular: 11111111111
I already have the value in the database, I would like to present these values formatted with the following masks:
Telephone = (11) 1111-1111 Cellular = (11) 11111-1111
Could someone help me ? I would just apply the masks via Javascript do not want to put in the input, because I save the value only numeric in BD, I would just like to present it formatted.
If anyone can help, thank you!
You can use subtring
– Bruno H.
I edited my answer, for lack of attention I answered about formatting in an input, but I’ve arranged for your case, take a look there! If you can mark it as a correct answer, thank you ;)
– Lucas Henrique
An example of how to format any type of pattern flexibly with a single function: https://answall.com/a/55235/4793
– Daniel Omine
Bruno, thank you, but I used our friend’s solution below. Still thank you!
– Fábio Monteiro