Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "num-parse"
version = "0.1.2"
version = "0.2.0"
edition = "2021"
description = "Generic, JavaScript-like parseInt() functions for Rust."
description = "parseInt() and parseFloat() as known from JavaScript, but generic, and in Rust"
authors = [
"Jan Max Meyer <jmm@phorward.de>"
]
Expand All @@ -13,6 +13,9 @@ categories = [
]
keywords = [
"parseint",
"parsefloat",
"javascript",
"ecmascript",
"numbers"
]

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2022 by Jan Max Meyer, Phorward Software Technologies.
Copyright © 2024 by Jan Max Meyer, Phorward Software Technologies.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
[![crates.io](https://img.shields.io/crates/v/num-parse)](https://crates.io/crates/num-parse)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

Generic, JavaScript-like parseInt() functions for Rust.
Generic, JavaScript-style parseInt() and parseFloat() functions for Rust.

This crate is intended to provide a fast and generic `parseInt()`-like implementation for Rust, which mostly follows the specification described in the [MDN parseInt() documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt).

Likewise in JavaScript, a `parseFloat()`-like implementation for float-types is planned as well, therefore the crate has been named `num-parse` already, althought it currently provides `parse_int()` and variative functions only.
This crate is intended to provide a fast and generic `parseInt()`- and `parseFloat()`-like implementation for Rust, which mostly follows the specification described in the MDN documentation for [parseInt()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) and [parseFloat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat).

## parse_int(), parse_uint()

Expand All @@ -33,3 +31,11 @@ assert_eq!(
Some(3405691582usize)
);
```

## parse_float()

TODO

## PeekableIterator

This crate is required by and implemented together with the [Tokay programming language](https://tokay.dev) to parse and calculate numerical values from a `PeekableIterator`-trait, which is also defined here. A JavaScript-like numerical parsing was thought to be useful for other projects as well.
Loading
Loading