liquidity_check

Crates.ioliquidity_check
lib.rsliquidity_check
version0.1.0
sourcesrc
created_at2023-01-17 18:18:08.576014
updated_at2023-01-17 18:18:08.576014
descriptionValidate if a string represents a monetary value
homepagehttps://github.com/b3nj5m1n/liquidity_check
repositoryhttps://github.com/b3nj5m1n/liquidity_check
max_upload_size
id761153
size8,030
(b3nj5m1n)

documentation

README

Liquidity Check

A rust library for checking if a string represents a valid monetary value.

assert_eq!(validate("$50"), true);
assert_eq!(validate("€ 50"), true);
assert_eq!(validate("50 EUR"), true);
assert_eq!(validate("50.0 ¥"), true);
assert_eq!(validate("50"), false);
assert_eq!(validate("50 ER"), false);
assert_eq!(validate("50_$"), false);
assert_eq!(validate("50,000 PAB"), true);

Note

The current implementation is quite simple, so in some edge cases it's possible to get false positives.

Commit count: 4

cargo fmt