August 6, 200322 yr I have a field that is formatted to display as currency. I need to be able to, on rare occasion, enter a word. Is there any way to be able to do both?
August 7, 200322 yr Make it a text field, and any calculations you need to do can be done with TexttoNum(field). Text to Num turns 600 into 600, Joe into nothing, Joe86 or 86Joe into 86, or J8a6 into 86, etc. It just ignores non-numeric characters.
August 7, 200322 yr This is true with the caveat that it doesn't ignore 'Y', 'N', 'T', 'F', etc., depending on the language for the system setttings. TextToNum("N86") = 0, for example. So use TextToNum( "a" & fieldname ) to ensure the desired result.
August 7, 200322 yr Interesting. It's not doing that for me. I can put Y,N,T,F,y,n,t,f anywhere in the text, even the beginning, and TexttoNum ignores it. I'm using FMP6 in OSX, and I'm speakin' American, by god! lol
August 7, 200322 yr Well, I'll be danged, it looks like 5.5 has fixed this. That's nice to know. However, the single characters or words (y, n, t, f, yes, no, true, false) are still booleans. If you add at least one digit after them, then they work as desired. TextToNum( "N" ) = 0, TextToNum( "N1" ) = 1, whereas previously TextToNum( "N1" ) would result in 0. Anyway, if you're using at least 5.5, then you can forget what I said.
Create an account or sign in to comment