Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7718593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:12:11+00:00 2026-06-01T03:12:11+00:00

The title may have been confusing, but please let me explain: Currently when I

  • 0

The title may have been confusing, but please let me explain:

Currently when I am storing phone number with raw digits like 5554441234. Then in my template I was going to “format” the number into something like 555-444-1234.

I realized in Django’s localflavor, there is a US phone number field that checks if a string is in XXX-XXX-XXXX format.

So my question is should I enter the phone number as raw digits then format it in the template or should I enter the phone number in the formatted way using localflavor?

If I choose the latter, would the XXX-XXX-XXXX format restriction apply even to the database API level or in the Django admin page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:12:13+00:00Added an answer on June 1, 2026 at 3:12 am

    Store them as entered, only strip surrounding white space if necessary. The way a user formats its number stores semantic information that you do not want to lose by normalizing it. In the US the format XXX-XXX-XXXX is very common, but other locales use totally different formats. For example, where I live some common formats are: XX-XXX XXX XX, XXX/XXX XX XX, +46(0)70-XXX XX XX and so on ad nausem.

    The number displayed to the user should be in the same format as entered, otherwise he or she will think of it as munged or may not even recognize the number if it is formatted in a different style than the user is used to. See also this discussion: http://discuss.fogcreek.com/dotnetquestions/default.asp?cmd=show&ixPost=6079&ixReplies=6

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so the title may have been confusing so i have posted 2 code
May not have been the best title but anyways.. I have a stored procedure
Ok so my question title may have been a little confusing. Here's my example:
The title may be a little confusing, but I don't know how else to
I understand the title may sound confusing, but the goal is very clear: I
As the title may suggest, I have been using jQuery AJAX to try and
This title may seem strange, so let me try to explain what I'm trying
I understand the title may be a little vague, but, hopefully, I can explain
This may have been asked a lot but I'm still lost. I need to
The title may be a bit vague, but here's my goal: I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.