To create the aNumber variable it converts the string value 123 to a number

# To create the anumber variable it converts the string

• Test Prep
• 334

This preview shows page 158 - 161 out of 334 pages.

To create the aNumber variable, it converts the string value "123" to a number. Because it already created the aString variable with a value of "123", the second code line can use the following format: var aNumber = ToNumber(aString); Convert String to Floating-Point Number Method The Convert String to Floating-Point Number method converts an alphanumeric string to a floating- point decimal number. It returns a floating-point decimal number. If it cannot convert to a number the value that the string argument contains, then it returns the following value: NaN For more information, see “NaN Numbers” on page 29 .
Methods Reference Conversion Methods Siebel eScript Language Reference Version 8.1, Rev. A 159 Format parseFloat( string ) Table 86 describes the arguments for the Convert String to Floating-Point Number method. How the Convert String to Floating-Point Number Method Handles the String The first character that is not a white space character must be a digit or a minus sign (-). For more information, see “Use White Space to Improve Readability” on page 57 . The Convert String to Floating-Point Number method does the following: Ignores white space characters that occur at the beginning of the string Treats the first period (.) in the string as a decimal point Treats any digits that follow the first period as the fractional part of the number Stops reading the string at the first nonnumeric character that occurs after the decimal point Ignores the first nonnumeric character it encounters Ignores all characters that occur after the first nonnumeric character Converts the result into a number Example The following example returns a result of negative 234.37: var num = parseFloat(" -234.37 profit"); Convert String to Integer Method The Convert String to Integer method converts an alphanumeric string to an integer. It returns an integer. If it cannot convert the value that the string argument contains to a number, then it returns the following value: NaN For more information, see “NaN Numbers” on page 29 . Format parseInt( string [,radix] ) Table 86. Arguments for the Convert String to Floating-Point Number Method Argument Description string The string that this method must convert.
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference Conversion Methods 160 Table 87 describes the arguments for the Convert String to Integer method. Usage If you do not specify the radix argument or if the value that the radix argument contains is zero, then the Convert String to Integer method uses a value of 10 for the radix unless the value that the string argument contains begins with one of the following values: The character pairs 0x or 0X. It uses a value of 16 for the radix. A zero and a valid octal digit. It uses a value of 8 for the radix. Any number zero through seven is a valid octal digit.

#### You've reached the end of your free preview.

Want to read all 334 pages?

• Summer '16
• Oracle
• Type system, Siebel, Siebel eScript

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern