Jump to content

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

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

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

Posted

Well, I'll be danged, it looks like 5.5 has fixed this. That's nice to know. smile.gif 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. laugh.gif

This topic is 7849 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.