7 个版本
| 0.2.1 | 2021 年 8 月 31 日 |
|---|---|
| 0.2.0 | 2021 年 8 月 27 日 |
| 0.1.4 | 2021 年 8 月 27 日 |
| 0.1.3 | 2021 年 7 月 12 日 |
#259 在 值格式化
每月 29 次下载
8KB
166 行
浮点数的 "G" 格式
使用 Display 实现通过 libc 的 printf() 打印浮点数,精确如 printf("%g", value)
用法
使用 crates.io 仓库;将其添加到您的 Cargo.toml 中,与其他依赖项一起
[dependencies]
gpoint = "0.2"
然后使用 GPoint 包装您的 f32 或 f64
use gpoint::GPoint;
println!("answer: {}", GPoint(42.));
有关详细信息,请参阅 API 文档
lib.rs:
使用 libc 的 printf("%g") 格式化输出浮点数
依赖项
~43KB