DefaultMacroRunner GetValueAs Method NFX Class Library

[This is preliminary documentation and is subject to change.]

Returns a string value converted to desired type with optional default and format

Namespace: NFX.Environment
Assembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
Syntax

public static string GetValueAs(
	string value,
	string type,
	string dflt = null,
	string fmt = null
)

Parameters

value
Type: OnlineSystem String
String value to convert
type
Type: OnlineSystem String
A type to convert string value into i.e. "decimal"
dflt (Optional)
Type: OnlineSystem String
Default value which is used when conversion of original value can not be made
fmt (Optional)
Type: OnlineSystem String
Format string that formats the converted value. Example: 'Goods: {0}'. The '0' index is the value

Return Value

Type: OnlineString
Converted value to desired type then back to string, using optional formatting and default if conversion did not succeed
See Also