Jump to content

[SOLVED] string represenation of number as number


mikesta707

Recommended Posts

Won't work. casting strings to ints only works when you have an int surrounded by quotes, like "2" or "5" or "15", however if you use the word, IE "two", "five", or "fifteen" they get cast to zero (as do all other non integer strings)

Ah, I didn't think you meant the word 'fifteen'.

 

Nope, no built-in function.  You'll most likely have to regex the string for a known number value, then return the integer equivalent.

 

Fake EDIT: or use one of the functions found in Mark's link.

thanks mark, the specific function you linked to is the opposite of what I want though hehe, (its ints to words, not words to ints). I was going to write the function but just wanted to know if there was a built in one already.

 

thanks everyone

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.