convertnumber

Crates.ioconvertnumber
lib.rsconvertnumber
version0.1.1
sourcesrc
created_at2021-07-08 11:58:51.375313
updated_at2021-07-08 12:13:30.842904
descriptionThis is a simple crate to illustrate number conversion from float to integer, I was trying out `impl` and `traits` and thought it was cool to build something from it
homepage
repository
max_upload_size
id420305
size3,483
Ukpai Ugochi (hannydevelop)

documentation

README

This is a simple crate to illustrate number conversion from float to integer.

Install this crate with cargo install convertnumber. To convert your number, pass it from the command line interface. For instance, Run cargo run 20.10 to get the output 21. I was trying out impl and traits and thought it was cool to build something from it. I'm using the Rust ceil method to round up Rust numbers. Since I'm collecting args with Strings collect method, args is String. I use the parse method to parse String to integer, then finally round it up to i32. /For now, this can only convert i64 type to i32. The goal in future is to convert an f32 or f64 type to i32 type.

Commit count: 0

cargo fmt