Announcement

Collapse
No announcement yet.

Parse Numeric string in Number

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lancill
    replied
    Re: Parse Numeric string in Number

    That's all right, it was a stupid problem: I had in input number like 5,16 or 7,00 etc...
    the "," can't be used in the number format (it need "."), so AMS viewed it as string!

    Thx again! [img]/ubbthreads/images/icons/smile.gif[/img]

    Leave a comment:


  • Worm
    replied
    Re: Parse Numeric string in Number

    You can use variables in the expression too...

    %Num1% = "16"
    %Num2% = "2"
    %Sum1% = Evaluate (%Num1% + %Num2%)
    %Sum2% = Evaluate (16 + 2)

    Leave a comment:


  • Lorne
    replied
    Re: Parse Numeric string in Number

    "16" + "2" will result in 18. There is no difference between numeric strings and numbers in AutoPlay.

    In fact, everything's a string internally, and it gets interpreted as a number/version/string at run time. All that matters is the operator you use.

    Note that if you try to add a number to a string, or add two numbers that aren't entirely numeric (like "16" + "2a" or something), then the values will be interpreted as strings.

    What is it you're trying to do, exactly?

    Leave a comment:


  • Worm
    replied
    Re: Parse Numeric string in Number

    AMS doesn't really have a variable type. Simply use the evaluate function (check box below the text box) in the Set Variable actions

    %SUM% = Evaluate (16 + 2)

    Leave a comment:


  • Lancill
    replied
    Re: Parse Numeric string in Number

    no... I have a numeric string!
    example:
    NUMERIC STRING: "16"
    I need to sum 2 to 16! But if I sum
    "16"+2 = "162"!! (Sum of string)
    I want to convert the string "16" to a number 16 so the sum 16+2 = 18! (Sum of number)
    It's like Integer.parse("162") in JAVA!!

    Leave a comment:


  • Worm
    replied
    Re: Parse Numeric string in Number

    Not sure what your asking here, but take a look at the String.GetDelimitedString action. It works like this:

    %SecondNumber% = String.GetDelimitedString ("5,16", 1)

    %SecondNumber% would equal 16

    Leave a comment:


  • Lancill
    started a topic Parse Numeric string in Number

    Parse Numeric string in Number

    I need to parse a numeric string in a number!! How can I do?
    Ex:
    STRING: "5,16"
    Number (I need to use it to calculate other numbers!): 5,16

    Thx [img]/ubbthreads/images/icons/smile.gif[/img]
Working...
X
😀
🥰
🤢
😎
😡
👍
👎