Crates.io | rsnum2persian |
lib.rs | rsnum2persian |
version | 0.1.0 |
source | src |
created_at | 2024-11-29 16:19:50.59204 |
updated_at | 2024-11-29 16:19:50.59204 |
description | A Rust library for converting numbers to their Persian representation. |
homepage | https://github.com/fadedreams/rsnum2persian |
repository | https://github.com/fadedreams/rsnum2persian |
max_upload_size | |
id | 1465777 |
size | 7,807 |
A Rust library for converting numbers to their Persian representation.
Add the following to your Cargo.toml
:
[dependencies]
rsnum2persian = "0.1.0"
use rsnum2persian;
fn main() {
let mut level = 0;
println!("{}", persian_number_converter::num_to_persian(5678, &mut level, false));
// Output: پنج هزار و ششصد و هفتاد و هشت
}
use rsnum2persian;
fn main() {
let mut level = 0;
println!("{}", persian_number_converter::num_to_persian(5678, &mut level, true));
// Output: پنج هزار و ششصد و هفتاد و هشتم
}
This library includes an example demonstrating its usage:
cargo run --example main