Number: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Created page with "Number(''number'') == Description == Number converts a string to a number. It works on floats and integers. == Example (BASIC) == <pre> Rem Number Example 'Number returns..."
 
Line 22: Line 22:
// Number returns the numeric value of a string
// Number returns the numeric value of a string


Var s
var s;
s = "3.145926"
s = "3.145926";
NSB.Print "The numeric value of s is " & Number(s)
NSB.Print "The numeric value of s is " & Number(s);
NSB.Print "The numeric value of TextBox1 is " & Number(TextBox1.value)
NSB.Print "The numeric value of TextBox1 is " & Number(TextBox1.value);
</pre>
</pre>



Revision as of 21:04, 13 January 2015

Number(number)

Description

Number converts a string to a number. It works on floats and integers.

Example (BASIC)

Rem Number Example
'Number returns the numeric value of a string

Dim s
s = "3.145926"
Print "The numeric value of s is " & Number(s)
Print "The numeric value of TextBox1 is " & Number(TextBox1.value)

Example (JavaScript)

// Number Example
// Number returns the numeric value of a string

var s;
s = "3.145926";
NSB.Print "The numeric value of s is " & Number(s);
NSB.Print "The numeric value of TextBox1 is " & Number(TextBox1.value);

Output

The numeric value of s is 3.1415926
The numeric value of txtFirstNo is 42

Related Items

conversions