Notifications
Announcements
No record found.
Hello!
I have this part of code:
someInt = str2int(someString);
info(someString + " " + int2str(someInt));
And the resoult is:
5 0
Any other ways to parse string to int?
*This post is locked for comments
Hi.
Your job shows the correct results when i run it:
static void Job1(Args _args)
{
int someInt;
str someString = "5";
}
How are you calling your code?
ok, This code really work. I put not the string I want to.
Hi,
did you check the unicode value of your single unicode char string?
maybe you have something similar what only look like the '5' digit within that?
only some example
str somestring2 = num2char(53); // DIGIT_FIVE 5 U+0035 (53) str somestring3 = num2char(65301); //FULLWIDTH_DIGIT FIVE U+FF15 (65301) // str2int will convert this to zero int someint2; int someint3; ; someint2 = str2int(somestring2); someint3 = str2int(somestring3); info(somestring2+ " "+int2str(someint2)); info(somestring3+ " "+int2str(someint3));
regards
Douglas
Hi, you say the code is not working. Please explain exactly what's wrong, what do want to do? Thanks!
I think what he meant is that the code works, but he used the wrong string.
that is exactly what I meant to :)
Can you mark your or others peoples responses as answered/verified so that people are aware the thread is closed
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2