Announcement

Collapse
No announcement yet.

Converting a string number into an integer splits the number up

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

    Converting a string number into an integer splits the number up

    Hi everyone

    Ok here's my problem.

    I get the score and stars from a level, they are integers, I transfer them as strings in order to store them into an array. When I want to read them, I convert them to integers again to display them ( In some cases, I need to add them up!)

    If I have 999 as a string and convert it to an integer, it fine, it will give me 999.

    But If I have 1,999 as a string and convert it as an integer, it will only give my 1. (Why is it putting a separator!!??!!)

    Also, I have an string array in which I keep information about a world. It looks like this 1:0:0:0 (world number: score : stars : locked?) So I split it with ':' character, when it comes to the score, if I have 7,845,245 , it will then again only give me 7.

    How to I get ride of the separator? And why do they put in a separator in if the integer will not even recognize it?

    Thanks,
    Last edited by maparizeau; 06-28-2015, 11:30 PM.
    The Hangar Studio - Video Game Studio

    An I for an I
    (Imagination equals Innovation)

    #2
    Never mind... found out what the culprit was. (banging head on desk now!)

    When I was converting integer to Text (ToText(int)), there's an option called Use Grouping. By default it is set the true. I had to set it to false.

    :-P
    The Hangar Studio - Video Game Studio

    An I for an I
    (Imagination equals Innovation)

    Comment

    Working...
    X