tests/testthat/test-thousands.R

context("thousands")

test_that("thousands format always adds k", {
    expect_equal(thousands(1000), "1k")
    expect_equal(thousands(1e+06), "1,000k")
    expect_equal(thousands(1e+09), "1,000,000k")
})

test_that("thousands_format format always adds k", {
  expect_equal(thousands_format()(1000), "1k")
  expect_equal(thousands_format()(1e+06), "1,000k")
  expect_equal(thousands_format()(1e+09), "1,000,000k")
})
stephlocke/optiRum documentation built on March 11, 2024, 2:25 a.m.