I told MMF2 to turn (1/3) into a string. It then displays 0.33333333333. I just want it to display 0.33. How do I do that?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Hmm.. does that code work with numbers that don't have decimal places? Because sometimes it's 1/3, sometimes 1/2, sometimes 1/1, etc I thought there'd be an easier way to, like one of those extensions or commands I never noticed.
Peblo, the program divides it in the expression editor, not a counter. And then puts it into a text string. I don't think that value handling is in the text string properties. I suppose I could put it into a temporary counter, pull it out, put the next one into a counter, etc, but that's gonna add about 3 more actions per loop and a few bugs along the way
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
I found the "easier" solution. Let's say X is the 1/3, 1/2 or whatever.
Round(X*100)/100.0
Replace 100 and 100.0 with 1000 and 1000.0 for 3 digits after decimal point, and so on.
It's ugly, but it works and is a bit more elegant than Sketchy's method. Just in case anyone is searching for a solution to the same problem in the future.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
That's a nice simple solution
Mine actually does something a bit different anyway. It limits the *maximum* nuber of decimal places, so "1" would still be "1", not "1.00" for example.
Mine also makes "1" appear as "1", not "1.00". But you have to divide it by 1.00 otherwise it won't work because of the really wierd way MMF handles integers and doubles.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.