Using Format Code for User-Defined Formats

Discuss the spreadsheet application

Using Format Code for User-Defined Formats

Postby uncouthyouth » Mon Jan 21, 2008 6:52 pm

Hello all,

I would like to know how to use the format code box in the Format dialog under user-defined to specify how to format a telephone number. For example, 5559931693 becomes (555) 993-1693 and so on. Any help would be much appreciated.
uncouthyouth
 
Posts: 2
Joined: Mon Jan 21, 2008 6:47 pm

Re: Using Format Code for User-Defined Formats

Postby huw » Mon Jan 21, 2008 6:59 pm

Code: Select all   Expand viewCollapse view
(###) ###-####
although that won't cope with leading zeros.
huw
Volunteer
 
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: Using Format Code for User-Defined Formats

Postby uncouthyouth » Mon Jan 21, 2008 7:14 pm

Perfect, thank you.
uncouthyouth
 
Posts: 2
Joined: Mon Jan 21, 2008 6:47 pm

Re: Using Format Code for User-Defined Formats

Postby acknak » Mon Jan 21, 2008 7:27 pm

You should think carefully about using a numeric value for telephone numbers: you will never be able to store a number that starts with a 'zero' digit. That may not be a problem (e.g. telephone numbers may be restricted to never start with a zero), but in general, it's unwise to store something that's not a number as a numeric value.

It's also true that if you don't store them as a numeric value, you can't use the format code--you would need a formula to format the number. You have to decide based on your project.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3


Return to Calc

Who is online

Users browsing this forum: No registered users and 22 guests