Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
  • Cheatsheet
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Intergrid Message Service
      • Local Storage
      • Merge Block Module
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Examples
  • Mother GUI
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
  • Mother Autopilot System (MAPS)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • Mother Core (Script Framework)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Architecture Overview
      • Managing Script Size & Complexity
    • Building A Module
    • Mother CLI (Console)
    • Core Modules
      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Clock
      • Command Bus
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Log
      • Terminal
    • Utilities

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Tutorials
  • Powered By Mother
  • Brand Guidelines

Number Helper

This utility provides a simple interface for parsing numeric types from strings. It is particularly useful when handling command arguments that may represent different numeric types.

  • Parsing Numbers
  • Supported Types

Parsing Numbers

The NumberHelper.Parse<T> method provides a generic way to parse strings into numeric types. It supports int, long, float, double, and decimal.

// Parse as int
int count = NumberHelper.Parse<int>("42");

// Parse as float
float distance = NumberHelper.Parse<float>("3.14");

// Parse as double
double precision = NumberHelper.Parse<double>("2.718281828");

// Parse as decimal
decimal currency = NumberHelper.Parse<decimal>("99.99");

Supported Types

TypeExample InputDescription
int"42"32-bit signed integer
long"9999999999"64-bit signed integer
float"3.14"Single-precision floating point
double"3.14159"Double-precision floating point
decimal"99.99"High-precision decimal
Last Updated: 4/14/26, 8:40 PM
Contributors: lukejamesmorrison
Prev
Color Helper
Next
Security