Forum Discussion

Kullay's avatar
Kullay
New Contributor III
7 years ago

Convert String to Number

Hi All,

how to convert String to Number,
Like :String str=“12SS”;
Number = 12SS
please help me on this Issue.

Thanks,
kullayappa

4 Replies

  • Hi Kullay

    I was able to use parseFloat(“22SS”) and parseInt(“22SS”) and result in the number 22.

    However, the SS is not a numeric value so it is not included. Is SS intended to be part of your number?

    If so, I’m not sure there is a way to have a number type that contains letters like ‘SS’

  • Anil's avatar
    Anil
    New Contributor III

    Hi @Kullay

    Could you please describe about your use case?

    Thanks,
    Anil

  • Kullay's avatar
    Kullay
    New Contributor III

    Hi Anil,

    I got the Issue, we need to use the Parseint() or Parseflot().

    Thanks,
    kullayappa