Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > String functions >

Val

Previous pageReturn to chapter overviewNext page

 

Description

 

Return the numeric equivalent of a string argument.

 

Syntax

 

n = Val(StringExpression [, nDecimals])

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

StringExpression

String

No

String expression to be converted into a number

nDecimals

Numeric

yes

Number of decimal places to return in the rounded number.

If this optional parameter will be specified, returned value will be rounded the number of decimal places indicated.

 

Remarks

 

Restrictions

 

See also

 

String Handling,

 

Examples