UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

Parameter Description Examples In the following example, UniData converts the value 12.339 to 1234 by rounding to two decimal places and converting to internal format: 1-347 UniBasic Commands Reference f Scales the input value num.expr by moving the decimal point f places to the right. If omitted, f defaults to the value assigned to n (for example, if you specify MD2, UniData reads it as MD22, and then ignores the first 2). dec_symbl You can specify a symbol to represent the decimal point in the input number by including dec_symbl. An example is provided in the following section. [prefix], [thsnd_mark], [suffix]] ] [,] [$] [-| < | E | C | D] [P] [Z] [T] [(xc)] INTERNAL.VAL = ICONV("12.339","MD2") The following example demonstrates how to specify that an alternate symbol is used to represent the decimal point in the input number. This example prints 12350. PRINT ICONV("123@499","MD2[,,@]") END Related Command UniBasic The ICONV function ignores these options, but they are included in the syntax to maintain consistency with the OCONV Masked Decimal (MD) function. ICONV Masked Decimal (MD) Parameters (continued) OCONV Masked Decimal (MD)

ICONV Left Justify (ML) Syntax ICONV(num.expr, "MLn [f] [ [ [prefix], [thsnd_mark], [dec_symbl], [suffix] ] ] [,] [$] [C] [Z] [(mask)]") Description The ICONV left justify (ML) function converts a decimal number to internal format after rounding, as specified by f. If the input value or conversion code is invalid, UniData returns the input value. Note: In BASICTYPE P, ICONV returns an empty string if UDT.OPTIONS 56 is on and the input value or conversion code is invalid. The ICONV MD, ML, and MR functions have the same result. They exist separately to maintain consistency with the OCONV MD, ML, and MR functions, which produce different results. Parameters The following table describes each parameter of the syntax. Parameter Description num.expr Decimal number to be converted. num.expr can be any numeric value with or without a decimal. n The ICONV function ignores n (for example, if you specify ML32, UniData ignores the 3), but it is included in the syntax to maintain consistency with the OCONV Left Justify (ML) function. ICONV Left Justify (ML) Parameters ICONV Left Justify (ML) 1-348

Parameter Description<br />

Examples<br />

In the following example, UniData converts the value 12.339 to 1234 by rounding to<br />

two decimal places and converting to internal format:<br />

1-347 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

f Scales the input value num.expr by moving the decimal point f places to the<br />

right. If omitted, f defaults to the value assigned to n (for example, if you<br />

specify MD2, UniData reads it as MD22, and then ignores the first 2).<br />

dec_symbl You can specify a symbol to represent the decimal point in the input number<br />

by including dec_symbl. An example is provided in the following section.<br />

[prefix],<br />

[thsnd_mark],<br />

[suffix]] ] [,]<br />

[$] [-| < | E |<br />

C | D] [P] [Z]<br />

[T] [(xc)]<br />

INTERNAL.VAL = ICONV("12.339","MD2")<br />

The following example demonstrates how to specify that an alternate symbol is used<br />

to represent the decimal point in the input number. This example prints 12350.<br />

PRINT ICONV("123@499","MD2[,,@]")<br />

END<br />

Related Command<br />

<strong>UniBasic</strong><br />

The ICONV function ignores these options, but they are included in the<br />

syntax to maintain consistency with the OCONV Masked Decimal (MD)<br />

function.<br />

ICONV Masked Decimal (MD) Parameters (continued)<br />

OCONV Masked Decimal (MD)

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

Saved successfully!

Ooh no, something went wrong!