Add examples to readme
Bumped version
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ntext"
|
name = "ntext"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
authors = ["Uttarayan Mondal <uttarayan21@gmail.com>"]
|
authors = ["Uttarayan Mondal <uttarayan21@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,28 @@
|
|||||||
|
|
||||||
A rust library to get numbers (u32) as words
|
A rust library to get numbers (u32) as words
|
||||||
|
|
||||||
12345 -> twelvethousandthreehundredfortyfive
|
`12345` -> `twelvethousandthreehundredfortyfive`
|
||||||
81123 -> eightyonethousandonehundredtwentythree
|
`81123` -> `eightyonethousandonehundredtwentythree`
|
||||||
12 -> twelve
|
`12` -> `twelve`
|
||||||
|
|
||||||
|
Add to cargo.toml
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[dependencies]
|
||||||
|
ntext = { git = "https://github.com/uttarayan21/ntext" }
|
||||||
|
```
|
||||||
|
|
||||||
|
Example program
|
||||||
|
|
||||||
|
```rust
|
||||||
|
extern crate ntext;
|
||||||
|
use ntext::to_text;
|
||||||
|
fn main() {
|
||||||
|
println!("{}",to_text(12345));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
which should output
|
||||||
|
`twelvethousandthreehundredfortyfive`
|
||||||
|
|
||||||
|
I will probably add formatting the text later
|
||||||
|
|||||||
Reference in New Issue
Block a user