Lines Matching refs:number_bytes
25 number_bytes(c(50, 400, 502, NA), symbol = "B"),
29 number_bytes(3:5 * 1024^2, symbol = "MiB"),
33 number_bytes(1000^(1:3), symbol = "kB", units = "si"),
38 expect_warning(number_bytes(c(50, 400, 502, NA), symbol = "k"), "must be")
41 expect_equal(number_bytes(1024, accuracy = .01), c("1.00 KiB"))
42 expect_equal(number_bytes(1024, units = "si", accuracy = .01), c("1.02 kB"))
43 expect_equal(number_bytes(1000, units = "si", accuracy = .01), c("1.00 kB"))
47 number_bytes(c(3e6, 4e6, 5e6), accuracy = .001),
51 number_bytes(c(3e6, 4e6, 5e6), units = "si", accuracy = .1),
56 expect_warning(number_bytes(1024^(1:2), "kB", units = "binary"), "KiB")
57 expect_warning(number_bytes(1024^(1:2), "KiB", units = "si"), "kB")
61 expect_equal(number_bytes(0), "0 B")
65 expect_equal(number_bytes(1024^11), "1 073 741 824 YiB")
66 expect_equal(number_bytes(1000^9, units = "si"), "1 000 YB")
70 expect_equal(number_bytes(-1024^2), "-1 MiB")
74 expect_equal(number_bytes(1024^(1:3)), c("1 KiB", "1 MiB", "1 GiB"))
78 expect_error(number_bytes(symbol = character()), "not length 0")
79 expect_error(number_bytes(symbol = c("kB", "MB")), "not length 2")
83 expect_named(number_bytes(c(a = 1)), "a")