|
Post by johnno56 on Dec 5, 2021 13:29:07 GMT -6
Is there a routine or method to simulate qbasic's Print Using command? I am trying to re-create the old 1945 shooter. Scoring involves shot accuracy (number of hits / shots fired) * 100. I would like to display the output with no more than one or two decimal places... Purely cosmetic.
|
|
|
Post by johnno56 on Dec 5, 2021 14:19:10 GMT -6
In the meantime, I have managed to convert accuracy and int(accuracy) to strings and manipulated to display one decimal place...
|
|
|
Post by n00b on Dec 6, 2021 0:58:41 GMT -6
You can accomplish this by using STR_F() to return a string with a fixed number of decimals (I believe its 6). Then just chop of the last few.
|
|
|
Post by rosy on Dec 11, 2021 9:11:13 GMT -6
Round (number of hits / shots fired * 10000)/100
or INT...
But is such accuracy really needed?
|
|
|
Post by johnno56 on Dec 11, 2021 14:24:09 GMT -6
Is such accuracy really needed? Probably not... But I like decimals... lol
Oh, alright! Round() or Int() it is... lol
J
|
|