Test whether a string is a signed integer or decimal.

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_validate_numeric

Purpose

Test whether a string is a signed integer or decimal.

Arguments

  • $1 — Candidate numeric value.

Returns

  • 0 for digits with an optional preceding minus and optional decimal fraction; 1 otherwise.

Usage

  sgnd_validate_numeric "-42.5"