Search Results for

    Show / Hide Table of Contents

    Method EnvDecimal

    | Improve this Doc View Source

    EnvDecimal(String, Decimal)

    Gets the value of a variable in decimal format.

    Declaration
    public virtual decimal EnvDecimal(string variable, decimal defaultValue = 0M)
    Parameters
    Type Name Description
    String variable

    Environment variable name.

    Decimal defaultValue

    A default value in case the variable is not set.

    Returns
    Type Description
    Decimal

    A value of the environment variable in decimal format.

    Implements
    IEnvReader.EnvDecimal(String, Decimal)
    Remarks

    If the environment variable is not set, the method will return the default value.

    Exceptions
    Type Condition
    ArgumentNullException

    variable is null.

    FormatException

    value is not in decimal format.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright ©2021 DotEnv.Core