[Stable]

extract_grading(grading_string)

Arguments

grading_string

A string in the format <grading>_<label>. These strings are field values of the form "Burn Grading". E.g. "0.5_test-label", "2.0_other-label".

Value

The grading as numeric value, e.g. 0.5, 2.0.

See also

Examples

testthat::expect_equal(extract_grading("0.0_test"), 0.0)
testthat::expect_equal(extract_grading("0.5_test"), 0.5)
testthat::expect_equal(extract_grading("1.0_test"), 1.0)
testthat::expect_equal(extract_grading("1.5_test"), 1.5)
testthat::expect_equal(extract_grading("2.5_test-with-long-label"), 2.5)