tests/testthat/test-numeric.R

test_that("to_numeric works", {
    expect_equal(to_numeric("2,000,000.00"), 2000000.0)
    expect_equal(to_numeric("2 000 000,00"), 2000000.0)
    expect_equal(to_numeric("2 000 000.00"), 2000000.0)
    expect_equal(to_numeric("2.000.000,00"), 2000000.0)
    expect_equal(to_numeric("20.0"), 20.0)
})

Try the ledger package in your browser

Any scripts or data that you put into this service are public.

ledger documentation built on May 29, 2024, 1:21 a.m.