Page 1 of 1

Phone formatting

PostPosted: Thu Mar 28, 2024 3:16 pm
by alasdairs
Hi all,

I was wondering how I could get a number in a text field from the database to be formatted as the full string. I have some phone numbers in the database at the moment but they are all being shown as #.#########E9. I need them to just be the string sent from the database just in case a number has a bracket, plus, space, or 0 at the beginning.

Thanks,
Alasdair

Re: Phone formatting

PostPosted: Thu Mar 28, 2024 4:49 pm
by mboegem
Seems to me that the field is currently a number/integer, which means it can not have a bracket/plus/space in the database.

In order to display numbers as text you can create a calculation in Servoy and use:
Code: Select all
utils.numberFormat(myField, '#')


You can then format the string with whatever rule you like.

Re: Phone formatting

PostPosted: Thu Mar 28, 2024 6:41 pm
by alasdairs
Thanks marc, that works perfectly!