Forum Discussion

alan_lee's avatar
alan_lee
New Contributor
12 years ago

The argument is not a number

I encounter the error : "The argument is not a number.", which didn't occur with the same codes.



As far as I know, the key word "var" covers integer, float, string etc.

So, I use "var" all the time w/o any problem.



I've looked up the with the key word : "The argument is not a number", but I couldn't find any. 



Anybody has same problem?

3 Replies

  • alan_lee's avatar
    alan_lee
    New Contributor

    function ConvertDollarStringToPenny(dollarValueInString)


    {


      try


      {


        var amountInPenny = 0;


        if(dollarValueInString == null)


        {


          Log["Error"]("Dollar value to convert into Penny can't be null");


        }


        else


        {


          Log.Message(dollarValueInString);


          //Check if the amount is in $


          if(aqString["Find"](dollarValueInString, "$") != -1)


            amountInPenny = aqConvert["StrToInt"](aqConvert["FloatToStr"](aqConvert["StrToFloat"](dollarValueInString) * 100));


          else


            amountInPenny = dollarValueInString;


        }


          


        return amountInPenny;


      }


      catch (exception)


      {


        Log["Error"]("An exception has occurred while converting the Dollar string value to Penny: " + exception.description);


      }


    }