-
Notifications
You must be signed in to change notification settings - Fork 1
FormatNumber
jdubs edited this page Oct 21, 2016
·
1 revision
Attempts to parse the input variable as a defined number type.
SpecName (constant) The variable containing the input to be converted.
NumberFormatCode (multiple | optional) The number format code (see addendum 2).
ErrorMessage (multiple | optional) The error message to return when any error occurs.
This method accepts the value supplied in the variable and formats it utilizing the code supplied. The format reference is available in the MSDN
public static void FormatNumber(string SpecName, object NumberFormatCode, object ErrorMessage)
{
Break();
try
{
double val = N(Variable(SpecName).Value);
Variable(SpecName).Value = val.ToString((string)NumberFormatCode);
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}