change text to number

This topic contains 2 replies, has 2 voices, and was last updated by  dylan peng 1 week, 1 day ago.

  • Author
    Posts
  • #3715

    dylan peng
    Participant

    Hi, i am very new to gdl. currently i have had a parameter called scale which is a text type parameter so that i can input the scale like 1/50. but how to change string 1/50 to number 1/50. i know SPLIT is the function i am looking for. But anyone can help the script to make it work? Thanks a lot!

    DRAGONFLY44

  • #3717

    Denny Wong
    Participant

    Hi there,

    Here’s a sample:

    n = split("1/50", "%n%s%n", j,k,l)
    print "Scale is ", j, " to ", l, " or ", j*2, " to ", l*2, " if you are really mad"
    • #3719

      dylan peng
      Participant

      Hi Denny,

      thanks a lot!

      DRAGONFLY44

You must be logged in to reply to this topic.