Alice Community  

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

Reply
 
Thread Tools Display Modes
How can I display numbers without decimal points?
Old
todd0312
Member
 
todd0312's Avatar
 
Status: Offline
Posts: 35
Join Date: Sep 2011
Default How can I display numbers without decimal points? - 10-20-2011, 04:40 PM

Maybe this is a dumb question, but I am a noob, , so...

I am taking an introductory programming course, and we are doing a program where we have our character sing(say) the song "99 of Pop on the wall" (no beer). My issue is that the song displays as "1.0 bottle, 2.0 bottles", etc. and I would prefer simply "1 bottle, 2 bottles", etc.

Is there a way to display numbers in this way without the decimal points?

Any feedback will be greatly appreciated.

Thanks in advance.

Todd
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,187
Join Date: May 2010
Location: e4eaf2
Default 10-20-2011, 07:32 PM

That's actually pretty simple.

You have your "say (variable) as a string" function, right?
Well, there's another world function that says "int a as a string". Put that in as well. It should look like "say 'int (variable) as a string' as a string".

That help?


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Thanks!
Old
todd0312
Member
 
todd0312's Avatar
 
Status: Offline
Posts: 35
Join Date: Sep 2011
Default Thanks! - 10-21-2011, 07:13 PM

Thanks a lot!

Leave it to a noob. Oh well...

So... problem solved... just in time to get my project in.

Much appreciation.
   
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.