Main Menu
- The Library NEW
A FORUM FOR THE MASSES
C64FORUM.COM
My VGP.ca Referral Code Get $5 off your first purchase!
A FORUM FOR THE MASSES
C64FORUM.COM
My VGP.ca Referral Code Get $5 off your first purchase!
Here's a handy mathmatical formula for rounding numbers to the number of decimal places specified in the variable DP:
10 def fn rd(x)=int(x*10^dp+.5)/10^dp
(note: replace the carat symbols above with the up arrow on the Commodore keyboard)
An example below will round the square root of 5 to 2 decimal places:
20 dp=2 30 print fn rd(sqr(5))