Table of Contents

ThrowIfNotNumber Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfNotNumber(string, NumberStyles, IFormatProvider, string, string)

Validates and throws an ArgumentException if the specified argument is not a number.

public static void ThrowIfNotNumber(string argument, NumberStyles styles = NumberStyles.Number, IFormatProvider provider = null, string message = "Value must be a number.", string paramName = null)

Parameters

argument string

The value to be evaluated.

styles NumberStyles

A bitwise combination of NumberStyles values that indicates the permitted format of argument.

provider IFormatProvider

An IFormatProvider that supplies culture-specific formatting information about argument.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentException

argument must be a number.