-
Notifications
You must be signed in to change notification settings - Fork 37
Refactor number-formatter to use integers #1608
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @iml-team and @ip1981)
iml-gui/crate/src/page/filesystem.rs, line 172 at r1 (raw file):
fn files_view<I>(fs: &Filesystem) -> Node<I> { if let Some((u, t)) = fs.files_total.and_then(|t| fs.files_free.map(|f| (t - f, t))) { log!("used: {}, total: {}", u, t);
Why did this log disappear?
number-formatter/src/lib.rs, line 53 at r1 (raw file):
assert_eq!(format_bytes(5_323_330_102_372, Some(2)), "4.84 TiB"); assert_eq!(format_bytes(84_567_942_345_572_238, Some(2)), "75.11 PiB"); }
ZiB test case is missing in new version.
Turns out it's because it would overflow u64
.
Isn't it misleading to leave Z
and Y
suffices in the array then?
Also, isn't it reduction of functionality that might be undesirable?
number-formatter/src/lib.rs, line 57 at r1 (raw file):
#[test] fn test_format_number() { // TODO: assert_eq!(format_number(999999, Some(0)), "1M");
A TODO
Reviewable is down at the time of writing :) |
For what I've seen in the API part, we are using Django's |
Keep in mind that within the next week we will be using influx to get these numbers. |
We are not restricted to JS here, but Rust instead since this ultimately is compiled to WebAssembly. |
e1fc40d
to
75fc3de
Compare
Still |
I was trying to say that so far we were limited by JS and were not actually using large enough numbers, or somewhere there were incorrect appearance. |
7419cba
to
93cd429
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @iml-team and @ip1981)
93cd429
to
d750325
Compare
d750325
to
36661aa
Compare
36661aa
to
ad848ce
Compare
ad848ce
to
2fbd246
Compare
Make it print precise numbers if they are small enough. Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
2fbd246
to
f6837ff
Compare
Make it print precise numbers if they are small enough.
Closes #1567.
This change is