Chapter 3 DynaScript Predefined Objects
The Number
object
has these methods:
Number.toString( [radix] )
Returns a string representation of the Number object. A radix may be used if you wish to work with something other than base 10.
String.
This example creates a number object and converts the value to a string:
<!--SCRIPT
num = new Number( 16 );
stringNum = num.toString();
document.WriteLn( stringNum );
-->
Number.valueOf( )
Extracts the number value of the number object as an integer.
Integer.
This example creates a number object, and then
converts it back to an integer, which is held in the variable intNum
.
<!--SCRIPT
num = new Number( 16 );
intNum = num.valueOf();
document.WriteLn( intNum );
-->
Copyright © 1999 Sybase, Inc. All rights reserved. |
![]() |