Jump to content

Capitalisation Problem (funny names)


This topic is 6674 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello all,

Ok so i have a nice formatting calculation on my surname field. So when you put in smith It will capitize it to read Smith.

However being from ireland we have a lot of second names like O'Malley and O'Brien. Now the proper function really doesnt work with this guy for obvious reasons it only caps the first letter when it should do it with the first two letters.

My current code:

Case ( Login::Formatting = "On" ; Proper(Surname) ; Login::Formatting = "Off"; Surname )

I do it on a global formatting on off field so they can turn it on and off.

I have tried to proper the character using leftword and counting in the character but nothing seems to work any advice on this i would be very grateful.

Thanks,

D

Link to comment
Share on other sites

For the names with an apostrophe, such as the ones in your post you could use an Auto-enter calculation (replace existing)

Substitute(Proper(Substitute(Name;"'";" "));" ";"'")

this will not affect single word entries and will take care of o'malley etc.

Link to comment
Share on other sites

That's a good idea, but using space alone is not safe enough - some names might contain genuine spaces (e.g. "van damme" -> "Van'Damme").

Either use a word delimiting character that is (more) unlikely to appear in a name, such as !, #, $, etc., or surround the apostrophe with spaces:

Substitute (

Proper ( Substitute ( Name ; "'" ; " ' " ) ) ;

" ' " ; "'" )

Link to comment
Share on other sites

Hi guys thanks for the feedback however neither of those worked.

What i want to happen if the user types in

o'malley it goes to --> O'Malley

O'malley it goes to --> O'Malley

it will capitize the letter before and after the apostrophe.

Thanks again guys ,

D

Link to comment
Share on other sites

neither of those worked

Then I guess you have smart quotes enabled (in File -> File Options... -> Text).

Try to copy/paste the following formula. If it still doesn't work, type o'malley into name field, copy the apostrophe character, go into Define Fields and replace the single quote in the formula with apostrophe.

Substitute (

Proper ( Substitute ( Name ; "’" ; " ’ " ) ) ;

" ’ " ; "’" )

Link to comment
Share on other sites

This topic is 6674 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.