Alice Community  

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

Reply
 
Thread Tools Display Modes
Get rid of decimal points UGH
Old
anarchyart
Guest
 
Status:
Posts: n/a
Default Get rid of decimal points UGH - 08-15-2008, 09:49 PM

Hail (jk),
I am doing my final project which is a rudimentary rpg. You have to kill these 6 toadstools, and when I convert the kill number to a string for use with a 3d text object, it says 1.0/6 or 3.0/6 instead of 1/6 or 3/6 which is what I want. Is there any way to do this? I have tried everything I know and this thing is due on Sunday.
Any help would be appreciated, and thanks in advance.
   
Reply With Quote
Quick solution
Old
DrJim
Guest
 
Status:
Posts: n/a
Default Quick solution - 08-16-2008, 07:21 AM

Since you only have six fractions to display, the cleanest approach is to use a "nested if" similar to the attached. (In the example, remember the loop index starts at zero, not 1.)

I have never found a "convert to string" approach that consistantly avoids the decimal point.

An approach that was claimed to work was posted at http://www.alice.org/community/showt...hlight=decimal but I haven't personally tried it.
Attached Files
File Type: a2w integer display.a2w (166.7 KB, 87 views)

Last edited by DrJim; 08-16-2008 at 07:23 AM. Reason: Added reference
   
Reply With Quote
Old
anarchyart
Guest
 
Status:
Posts: n/a
Default 08-20-2008, 01:39 AM

Thanks so much, it worked pefectly. I didn't know you could use expressions as maximum and minimum. Thanks again!
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.