I am trying to make a simulated baseball thing that shows batting average by dividing Hits by At Bats, but the variable simply says "0.2" rather then "0.245" or whatever. Obviously, this is a big problem, as simply "0.2" hardly tells a person anything at all. So, is there any way to get the variable to only round off to 3 decimal places?
Offline
I guess that works, though it does make everything look unorganized
Offline
actually, it still doesnt round to 3 decimal places...
Offline
Okay i did the join thing, now all i need to know is how to round it to 3 places so its not .233333333333333
Offline
Hm... well, you could multiply by a factor of 10 (such as 1000) before dividing. That way it wouldn't try to round it. If you still wanted it to show it as a decimal, you could use the "Join" block to add a decimal point.
Offline
This will need 3 variables: Score, Actual Score, Index
The score and index should be hidden, the actual score should be show.
When round score is broadcasted the variable score should be set.
When I recieve broadcast [round score]
Set [Actual Score] to ()
Set [Index] to (1)
Repeat Until <(letter (index) of (score)) = (.) >
Set [Actual Score] to (join (Actual Score)(letter(index) of (score) ) )
Change [Index] by (1)
{End of Repeat Until}
Repeat (4)
Set [Actual Score] to (join (Actual Score)(letter(index) of (score) ) )
Change [Index] by (1)
{End of Repeat}
Sorry if that's hard to understand
Last edited by laptop97 (2011-09-05 17:38:43)
Offline
okay i think i got it...let me try it and see if it works
Offline
im fairly certain i copied everything correctly, but it is still not rounding...
Offline
Thanks for trying to help me though
it is kinda annoying that everything else in the project took 10 minutes to make and this has taken an hour and it still isnt finished -.-
Offline
Frogdunker wrote:
Thanks for trying to help me though
it is kinda annoying that everything else in the project took 10 minutes to make and this has taken an hour and it still isnt finished -.-
So, are you going to upload it?
Offline
oh, i just saw what u said
Offline
okay i uploaded it....its kinda sloppy but that doesn't matter
Offline