Method: ParseNumber( … )

Use to parse numbers and clean dirty numbers. Will parse a content object from the beginning until it finds something that can be interpreted as a number. Will return an object that contains the number found (if any), as well as what pre- and post-fixes the number. Remark when using Actions in Item Triggers the numbers are always stored in US scientific format and to force ParseNumber to use US format add the optimal parameter cultureInfo = System.Globalization.CultureInfo.InvariantCulture.

Syntax

{ScriptObject} ParseNumber( object content, CultureInfo cultureInfo )

Example

Value = "$ 499.75 pallet"; var num = ParseNumber( Value ); if( num.Value.HasValue ) Value = num.Value; // will be 499.75 (double) var currency = num.Pre; // will be "$" var priceUnit = num.Post; // will be "pallet"