0

I'm making a game and I need a text box to show only whole numbers, such as "999" and not "999.58". This is messing up the image because it's too big and it's outside the text box and there's also no need for the player to see the decimals. I'm using the simple call (this.text1:Number=_root.text2) but '_root.text2' has decimal and that's what I want to remove. Thanks in advance.

Eddy Cpr
  • 1
  • 1
  • 1
    Does this answer your question? [how do you display a variable in a text field? AS3](https://stackoverflow.com/questions/4251402/how-do-you-display-a-variable-in-a-text-field-as3) – Semo Dec 19 '22 at 10:51
  • Use **Math.floor(_root.text2)** (returns closest integer value below or equal to the given) or **Math.round(_root.text2)** (returns closest integer value). – Organis Dec 19 '22 at 15:08
  • i used "Math.floor()" and solved my problem. thanks man very much you saved me.. – Eddy Cpr Dec 19 '22 at 17:24

0 Answers0