User:anonymousLog inRegister
Recents:
ToNumeric Method

Scope

Objects: Procedures, Transactions, Web PanelsWork Panels
Languages: .NET, Java, Ruby, Visual FoxPro

Purpose

Converts a number in character format to numeric format.

Syntax

character-expression.ToNumeric()

Type Returned:
Numeric N(18.2)

Where:
character-expression
    Must be a character expression.

Description

This function converts the numbers of a character expression to a numeric type. It processes the numbers in the character expression from left to right until a non-numeric character is encountered. If the first character of the character expression is not a number, the result of Val function will be 0.

Examples

&AcceptTxt9 = '-123.35'
&Nbr = &AcceptTxt9.ToNumeric() // Result: &Nbr = -123
&AcceptTxt9 = 'ABC'
&Nbr = &AcceptTxt9.ToNumeric() // Result: &Nbr = 0
&AcceptTxt9 = '12A'
&Nbr = &AcceptTxt9.ToNumeric() // result: &Nbr = 12

See Also

Val Function
Str Function
ToString Method

Created: 12/16/09 11:23 AM by dmarquez Last update: 07/13/10 05:04 PM by dmarquez
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)