formcycle 8.4.0 - JavaScript for forms
    Preparing search index...

    Interface NumberFormatApiGet

    The API for getting information from NumberFormat elements, such as the current value.

    The API is available via $.xutil.numberFormat.get.

    interface NumberFormatApiGet {
        options: (reference: any) => NumberFormatOptions;
        valueFormatted: (reference: any) => string;
        valueNumeric: (reference: any) => number;
        valueNumericString: (reference: any) => string;
    }
    Index

    Properties

    options: (reference: any) => NumberFormatOptions

    Gets the current options of the first of the given NumberFormat elements. When the element does not have a NumberFormat instance, throws.

    Type declaration

    If the element does not have a NumberFormat instance.

    valueFormatted: (reference: any) => string

    Gets the current value of the first of the given NumberFormat elements as a formatted string, according to the current options. When the NumberFormat element is empty, returns an empty string. When the element does not have a NumberFormat instance, throws.

    Type declaration

      • (reference: any): string
      • Parameters

        • reference: any

          The element to get the value from.

        Returns string

        The current value of the element, or an empty string when the element is empty.

    If the element does not have a NumberFormat instance.

    valueNumeric: (reference: any) => number

    Gets the current value of the first of the given NumberFormat elements, as a number. When the NumberFormat element is empty, returns undefined. When the element does not have a NumberFormat instance, throws.

    Type declaration

      • (reference: any): number
      • Parameters

        • reference: any

          The element to get the value from.

        Returns number

        The current value of the element, or undefined when the element is empty.

    If the element does not have an NumberFormat instance.

    valueNumericString: (reference: any) => string

    Gets the current value of the first of the given NumberFormat elements as a numerical string. When the NumberFormat element is empty, returns an empty string. When the element does not have an NumberFormat instance, throws.

    This is similar to valueNumeric, but returns the value as a string instead of a number. This prevents issues with floating point precision.

    Type declaration

      • (reference: any): string
      • Parameters

        • reference: any

          The element to get the value from.

        Returns string

        The current value of the element, or an empty string when the element is empty.

    If the element does not have a NumberFormat instance.