21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Numbers 14<br />

Specification of Explicit Numbers<br />

Numbers can be presented in several ways, for example, in decimal format or in scientific<br />

notation, or even with a different base than the decimal system. The following rules apply to<br />

numerical characters in <strong>OpenOffice</strong>.<strong>org</strong> Basic:<br />

Whole Numbers<br />

The simplest method is to work with whole numbers. They are listed in the source text<br />

without a comma separating the thousand figure:<br />

Dim A As Integer<br />

Dim B As Float<br />

A = 1210<br />

B = 2438<br />

The numbers can be preceded by both a plus (+) or minus (-) sign (with or without a space<br />

in between):<br />

Dim A As Integer<br />

Dim B As Float<br />

A = + 121<br />

B = - 243<br />

Decimal Numbers<br />

When you type a decimal number, use a period (.) as the decimal point. This rule ensures<br />

that source texts can be transferred from one country to another without conversion.<br />

Dim A As Integer<br />

Dim B As Integer<br />

Dim C As Float<br />

A = 1223.53 ' is rounded<br />

B = - 23446.46 ' is rounded<br />

C = + 3532.76323<br />

You can also use plus (+) or minus (-) signs as prefixes for decimal numbers (again with or<br />

without spaces).<br />

If a decimal number is assigned to an integer variable, <strong>OpenOffice</strong>.<strong>org</strong> Basic rounds the<br />

figure up or down.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!