is_number

Crates.iois_number
lib.rsis_number
version0.1.1
created_at2024-11-17 23:26:12.673874+00
updated_at2024-11-17 23:37:31.385688+00
descriptionCheck if a string can be parsed as a number
homepage
repositoryhttps://github.com/dotslashbit/is-number-rs
max_upload_size
id1451598
size6,421
Sahil (dotslashbit)

documentation

https://docs.rs/is_number

README

Is Number

A Rust library to check if a string represents a valid number.

Usage

Add this to your Cargo.toml:

[dependencies]
is_number = "0.1.0"

Examples

use is_number::is_number;

fn main() {
assert!(is_number("123"));
assert!(is_number("-123.456"));
assert!(is_number("1.23e-5"));
}
Commit count: 5

cargo fmt