Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I remove the decimal (.0)
Old
chellydee
Junior Member
 
Status: Offline
Posts: 9
Join Date: Jul 2016
Question How do I remove the decimal (.0) - 08-06-2016, 09:28 PM

I'm working on an assignment, in which I have to make an Alice character say an integer, but also include a statement in the method that will decrement the integer with each loop. I have both a variable with the starting number value and a variable to say the number as a string. However, my character says the number as "100.0" vs "100".....
how do I fix this issue?
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default 08-06-2016, 09:57 PM

Just toss in a world.int function onto the variable you want to display.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
chellydee
Junior Member
 
Status: Offline
Posts: 9
Join Date: Jul 2016
Default 08-06-2016, 10:31 PM

Quote:
Originally Posted by RavenOfCode View Post
Just toss in a world.int function onto the variable you want to display.
Thanks a bunch....that worked out exactly how I needed it to!
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.