So I attempted writing a function that would return the largest value in a string (and for some reason I feel like it's bad practice to do so, someone said something like that once maybe), and I got it to work, but it only works with positive floats and integers, but not negatives.
function returnLargestValue(%string)
{
   if(!strlen(%string))
      return false;
   %string = trim(%string);
   %count = getWordCount(%string);
   for(%i = 0; %i < %count; %i++)
   {
      %number = getWord(%string, %i);
      %value[%i] = %number;
      if(%value[%i] > %highestNumber)
         %highestNumber = %value[%i];
   }
   return %highestNumber;
}
What's going on here, and how do I fix it? I've tried bitwise or with the function, but that just screws it up entirely. I don't know what else to do.