0

Rails 3.2 , Using MySQL database . What datatype should I use to the field of Phone number?

Am currently using t.integer, but its not supporting the length of Phone number which has more than 12 digits. Please Help!

1 Answer 1

2

You could use 64-bit integers (which can store numbers as high as 9,223,372,036,854,775,807), as described here.

However, I think that phone numbers are better stored as strings than integers, since you may need to represent leading zeroes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.