Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] Can you set a text max length?

Author
Message
dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 8th Jul 2020 18:55
I'm converting a float to a string to display damage numbers .instead of 1.0000000 I would like it to print only the first 4 characters. Is this possible?

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 8th Jul 2020 19:08 Edited at: 8th Jul 2020 19:12
This post has been marked by the post author as the answer.
You can use str( variable# , 3) to display up to 3 decimal places of a float variable.

You could also use Left( str( variable#), 4) to simply get the first 4 characters of the number result.
dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 8th Jul 2020 19:29
Awesome! Thank you bengismo

Login to post a reply

Server time is: 2024-04-25 15:50:09
Your offset time is: 2024-04-25 15:50:09