Numerical values: switching commas with dots!

0 favourites
  • 5 posts
From the Asset Store
Compete online with friends and family with most popular Dots n Lines (Dots and Boxes) game
  • Hi everyone,

    I know this sounds like a newbie question but i dont think it is... i've been trying to replace commas with dots on textbox entered numerical values but i've been fruitless.

    The problem is that the user might type 155,32 instead of 155.32 which is different for a calculation.

    How can i fix this?

    I know this is pretty much an algorithm issue but i've tried everything and i'm starting to lose hope...

    Please help!

    Thank you for your time!

  • I have not tested this.. but according scirra.com/manual/126/system-expressions there is ready made function for replacements.

    replace(src, find, rep)

    Find all occurrences of find in src and replace them with rep.

    One things that C2 direly needs is a lot more deeper user manual. The system expressions part is totally inadequate on explaining all the functions available. Especially those Regexp- commands ...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I must agree with you.

    Thank you so much for your help and quick reply. I'll look into it and i'll post back my results. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Okay so...

    Textbox -> Set text to replace(textbox.text, ",", ".")

    WORKS!

    Thank you so much Joannak!

    You probably saved my job <img src="smileys/smiley36.gif" border="0" align="middle" />

    PS: i never understood thats what this function is for from the manual reference.

    SOLVED!

  • Well. I was not sure either, but it sounded like a right one to try.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)