3 ms·
Relatedly: telephone numbers. (555) 555-5555 is understood by every American above the age of like six. Why can't your website figure it out? phone_number.gs
by patio11 17y ago
Relatedly: telephone numbers. (555) 555-5555 is understood by every American above the age of like six. Why can't your website figure it out? phone_number.gsub!(/[^0-9]/, "") prior to processing, pretty_print_phone_number(phone_number) in the view, and you're freaking done.
Relatedly but of less obvious salience to most Americans: if you tell me to write my name in hankaku kana and I write it in zenkaku kana then rather than telling me to rewrite it, call your zenkakuToHankaku function on my input, see if it contains anything other than kana, and if not just coerce the input over. I have been on a crusade to do this at my day job.
- ars 17y agoTwo reasons: Force people to enter their area code. What do you do about international numbers? It's a bit more complicated, and the grouping is less obvious.
- nandemo 17y agoThe kana part is a pet peeve of mine. It also happens for the address part. The only site I recall that does the conversion automatically is Google Adsense.