Constant777's Recent Forum Activity

  • What does your array look like ?, I presumed you loaded the text file into an array at 0,0

    I have Array with such ";" separator

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you load a text file that contains 11;22;33;44;55;66;77;88 to an array, it will be at 0,0 I presume, so you can use tokenat to find 22.

    Set Testvariable to tokenat(Array.At(0,0),1,";")

    I just chek it by "tokenat".

    Now I've got "NaN" in "TESTvariable" :(

  • Hi!

    I have 2D array "2DArray" making by AJAX requesting .txt file:

    11;22;33;44;

    55;66;77;88;

    and I have global variable (type number):

    "TESTvariable"

    I need to set "22" to "TESTvariable"

    I make this:

    Set "TESTvariable" to 2DArray.At(0,1,";")

    But I've got a 0 to "TESTvariable"

    So I make this:

    int(Set TEST to 2DArray.At(0,1,";"))

    But I've got a 0 to "TESTvariable" again.

    How do I set data from array to global variable (type number) correctly?

  • You do not have permission to view this post

  • take a look at this thread from a few days ago...

    https://www.construct.net/en/forum/construct-3/how-do-i-8/put-commas-numbers-160413#forumPost1042464

    if you want spaces, just replace the comma with a space character.

    Thanks! I couldn't find it. it's brilliant but incomprehensible but it works )))

    Set text to RegexReplace( str(int(num)), "(\d)(?=(\d{3})+(?!\d))", "g", "$&,")

    instead of "num", need to insert a number.

  • > I just figured somewhere along the way, there would be an option/check-box, short code, etc that changed the format to include commas in numbers that were greater than 3 digits.

    Did you look at AllenR's example?

    > Set text to RegexReplace( str(int(num)), "(\d)(?=(\d{3})+(?!\d))", "g", "$&,")
    

    Then add

    > -> Text: Append "."
    -> Text: Append int(abs(num)×10)%10
    -> Text: Append round(abs(num)×100)%10
    

    to pad the decimals.

    I don't quite understand how it works. more precisely, I did not understand how it works at all. but it works! thank you!!!

  • Hi!

    Can you tell me how to divide a number into digits?

    For example, 1000000 to turn into 1 000 000 or 1000 to turn into 1 000?

    Maybe there is any command in the Construct 3?

    Tagged:

Constant777's avatar

Constant777

Member since 5 Apr, 2021

None one is following Constant777 yet!

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies