ROUND
f = ROUND (x [, decs])
Rounds x
to the nearest integer or number with
decs
decimal digits. decs
is an optional
parameter.
Example 1: Round to nearest integer
12.3456
A = print round(A) ' Output: 12
Example 2: Round integer numbers
123456
A = print round(A/10) * 10 ' Output: 123460
print round(A/100) * 100 ' Output: 123500
print round(A/1000) * 1000 ' Output: 123000
Example 3: Round to decimal digits
12.3456
A = print round(A) ' Output: 12
print round(A, 1) ' Output: 12.3
print round(A, 2) ' Output: 12.35
Code samples using ROUND
005 challenge.bas
7gables.bas
another look at trig functions.bas
B+B.bas
bb2fork smurf.bas
betrayal: crows ii.bas
biorythms.bas
bolmo.bas
bomb.bas
bowling7.bas
btn 21.bas
calc.bas
checkers.bas
checkers.bas
chess.bas
chess.bas
colors1.bas
conrec-sb-v01.bas
coordplot.bas
crgb.bas
dmsareaplot.bas
dmsareareadmd.bas
dogstar5.bas
duckduckgo.bas
Euro_calculator.bas
Fifty50.bas
fiftyfifty v2.bas
filemanager.bas
fireworks.bas
Math
ABS
ABSMAX
ABSMIN
ACOS
ACOSH
ACOT
ACOTH
ACSC
ACSCH
ASEC
ASECH
ASIN
ASINH
ATAN
ATAN2
ATANH
ATN
CEIL
COS
COSH
COT
COTH
CSC
CSCH
DEG
DERIV
DETERM
DIFFEQN
EXP
EXPRSEQ
FIX
FLOOR
FRAC
INT
INTERSECT
INVERSE
LINEQN
LOG
LOG10
M3APPLY
M3IDENT
M3ROTATE
M3SCALE
M3TRANS
MAX
MIN
POLYAREA
POLYCENT
POLYEXT
POW
PTDISTLN
PTDISTSEG
PTSIGN
RAD
RND
ROOT
ROUND
SEC
SECH
SEGCOS
SEGLEN
SEGSIN
SEQ
SGN
SIN
SINH
SQR
STATMEAN
STATMEANDEV
STATMEDIAN
STATSPREADP
STATSPREADS
STATSTD
SUM
SUMSQ
TAN
TANH
TRANSPOSE
If there is insufficient information on this page and you wish learn more about ROUND,
please send an email to smallbasic@gmail.com. You can help to improve information about
ROUND by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.