parse_int
Parse &str
with common prefixes to integer and float values:
# use Error;
#
Pretty print numbers
The reverse is also possible
let pretty = format_pretty_dec;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Negative numbers are represented like a human would spell it, not in the memory representation or the two complement. This makes the output not type dependent, see std::fmt for that representation.
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Enable the "implicit-octal" feature
Specify the crate like this:
parse_int = { version = "0.9", features = ["implicit-octal"] }
Then this code will return Hello, Ok(34)!
:
use parse;
License
This work is distributed under the super-Rust quad-license:
Apache-2.0/MIT/BSL-1.0/CC0-1.0
This is equivalent to public domain in jurisdictions that allow it (CC0-1.0). Otherwise it is compatible with the Rust license, plus the option of the runtime-exception-containing BSL-1. This means that, outside of public domain jurisdictions, the source must be distributed along with author attribution and at least one of the licenses; but in binary form no attribution or license distribution is required.