Update bigint/bigdecimal (#2585)

* Update bigint/bigdecimal

* clippy
This commit is contained in:
Jonathan Turner
2020-09-22 05:28:31 +12:00
committed by GitHub
parent 7a595827f1
commit 9b577b8679
35 changed files with 263 additions and 132 deletions

View File

@ -60,7 +60,10 @@ pub async fn ps(tag: Tag, long: bool) -> Result<Vec<Value>, ShellError> {
if let Ok(status) = process.status().await {
dict.insert_untagged("status", UntaggedValue::string(format!("{:?}", status)));
}
dict.insert_untagged("cpu", UntaggedValue::decimal(usage.get::<ratio::percent>()));
dict.insert_untagged(
"cpu",
UntaggedValue::decimal_from_float(usage.get::<ratio::percent>() as f64, tag.span),
);
dict.insert_untagged(
"mem",
UntaggedValue::filesize(memory.rss().get::<information::byte>()),