Thanks a bunch. Using your outline + the manual I was able to figure it out (with a few changes, but a similar argument). Here is a piece of code with annotations in case anybody else has issues with this. This piece of code is in my function main.

Click to reveal..
var l=0; // Set a variable which will tell the length of your answer.
var r=0; // Set a variable which will tell you how much to cut off your answer.
while (1) //Set a loop to create your answer and display every tick.
{
c = a / b; // If you are calculating your variable elsewhere, this line is not needed. I'm using / because it lets us try various decimals.
str_for_float(answer,c); //Turns the variable "c" into a string with six decimal places. In my case, the global string is named answer.
l = str_len (answer); //Sets the variable l to be the length of the string.
while(str_getchr(answer,l)==48) //This condition checks the term in the lth position in the string (in other words, the last) to see if it is a zero (48 is the corresponding ASCII character for zero).
{l-=1; // if the last term is a zero, we subtract one from l and run the check again, now seeing if the previous term was a zero.
r=r+1; // before we check again, we update r to let us know we must remove another digit from the right side.
}
str_trunc(answer,r); //Once the loop checking for zeros is done, we remove r many terms from the end of the "answer" script.
draw_text(answer, 300, 350, vector (160,160,255)); //Now, we display it.
r=0; //Make sure we reset r, so that we don't take away too many digits next time we check.
wait (1); //And wait a tick so our loop doesn't crash the program.
}

Last edited by Hawthourne; 10/14/15 21:36.