#floating-point #libc #printf #io #output-format #f64 #f32

gpoint

Wrapper for using libc’s printf("%g") format for your floating point output

7 releases

0.2.1 Aug 31, 2021
0.2.0 Aug 27, 2021
0.1.4 Aug 27, 2021
0.1.3 Jul 12, 2021

#178 in Value formatting

Download history 5773/week @ 2024-11-27 5853/week @ 2024-12-04 6010/week @ 2024-12-11 5807/week @ 2024-12-18 6103/week @ 2024-12-25 5379/week @ 2025-01-01 5634/week @ 2025-01-08 5515/week @ 2025-01-15 4783/week @ 2025-01-22 5501/week @ 2025-01-29 3824/week @ 2025-02-05 3832/week @ 2025-02-12 3856/week @ 2025-02-19 3539/week @ 2025-02-26 3702/week @ 2025-03-05 3489/week @ 2025-03-12

15,195 downloads per month
Used in scx_lavd

MIT/Apache

8KB
166 lines

"G" Format for Floating Point

Prints floating-point exactly like a printf("%g", value), using a Display implementation via libc's printf()'s .

Usage

Use the crates.io repository; add this to your Cargo.toml along with the rest of your dependencies:

[dependencies]
gpoint = "0.2"

Then wrap your f32 or f64 with a GPoint:

use gpoint::GPoint;

println!("answer: {}", GPoint(42.));

See the API documentation for further details.


lib.rs:

Wrapper for using libc's printf("%g") format for your floating point output

Dependencies

~44KB