---
tags:
    - "String"
    - "Number"
    - "Parse"
    - "Digit"
    - "Valid"
    - "Float"
    - "Integer"
---

# Is Numeric

[Strings](index.md) / **Is Numeric**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns True if the whole text can be interpreted as a number

## Parameters

| Name | Description |
| :--- | :---------- |
| Text | The text that is checked |

## Code

```cs
using System;
using System.Globalization;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Is Numeric")]
    [Category("Strings/Is Numeric")]

    [Description("Returns True if the whole text can be interpreted as a number")]
    [Image(typeof(IconNumber), ColorTheme.Type.Yellow, typeof(BadgeString))]

    [Parameter("Text", "The text that is checked")]

    [Keywords("String", "Number", "Parse", "Digit", "Valid", "Float", "Integer")]

    [Serializable]
    public class TypeBoolStringIsNumeric : TypeBool
    {
        [SerializeField] private GetString m_Text = new GetString();

        public override bool GetPreview(GameObject source) => IsNumeric(this.m_Text.GetPreview(source));

        public override bool Get(Args args) => IsNumeric(this.m_Text.Get(args));

        private static bool IsNumeric(string text)
        {
            if (string.IsNullOrWhiteSpace(text)) return false;
            return double.TryParse(text, NumberStyles.Any, CultureInfo.InvariantCulture, out _);
        }

        public override string ToString()
        {
            return $"{this.m_Text} is Numeric";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

